introduce Polonius
enum for -Zpolonius
this allows to opt into using the legacy version or the in-tree prototype
This commit is contained in:
parent
2ffeb4636b
commit
4f7a27b225
6 changed files with 54 additions and 6 deletions
|
@ -3166,6 +3166,7 @@ impl PpMode {
|
|||
/// we have an opt-in scheme here, so one is hopefully forced to think about
|
||||
/// how the hash should be calculated when adding a new command-line argument.
|
||||
pub(crate) mod dep_tracking {
|
||||
use super::Polonius;
|
||||
use super::{
|
||||
BranchProtection, CFGuard, CFProtection, CrateType, DebugInfo, DebugInfoCompression,
|
||||
ErrorOutputType, InstrumentCoverage, InstrumentXRay, LdImpl, LinkerPluginLto,
|
||||
|
@ -3276,6 +3277,7 @@ pub(crate) mod dep_tracking {
|
|||
OomStrategy,
|
||||
LanguageIdentifier,
|
||||
TraitSolver,
|
||||
Polonius,
|
||||
);
|
||||
|
||||
impl<T1, T2> DepTrackingHash for (T1, T2)
|
||||
|
@ -3414,3 +3416,30 @@ impl DumpMonoStatsFormat {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// `-Zpolonius` values, enabling the borrow checker polonius analysis, and which version: legacy,
|
||||
/// or future prototype.
|
||||
#[derive(Clone, Copy, PartialEq, Hash, Debug)]
|
||||
pub enum Polonius {
|
||||
/// The default value: disabled.
|
||||
Off,
|
||||
|
||||
/// Legacy version, using datalog and the `polonius-engine` crate. Historical value for `-Zpolonius`.
|
||||
Legacy,
|
||||
|
||||
/// In-tree experimentation
|
||||
Next,
|
||||
}
|
||||
|
||||
impl Default for Polonius {
|
||||
fn default() -> Self {
|
||||
Polonius::Off
|
||||
}
|
||||
}
|
||||
|
||||
impl Polonius {
|
||||
/// Returns whether the legacy version of polonius is enabled
|
||||
pub fn is_legacy_enabled(&self) -> bool {
|
||||
matches!(self, Polonius::Legacy)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue