@@ -3121,9 +3121,9 @@ pub(crate) mod dep_tracking {
31213121 use super :: {
31223122 BranchProtection , CFGuard , CFProtection , CrateType , DebugInfo , ErrorOutputType ,
31233123 InstrumentCoverage , InstrumentXRay , LdImpl , LinkerPluginLto , LocationDetail , LtoCli ,
3124- OomStrategy , OptLevel , OutFileName , OutputType , OutputTypes , Passes , ResolveDocLinks ,
3125- SourceFileHashAlgorithm , SplitDwarfKind , SwitchWithOptPath , SymbolManglingVersion ,
3126- TraitSolver , TrimmedDefPaths ,
3124+ OomStrategy , OptLevel , OutFileName , OutputType , OutputTypes , Passes , Polonius ,
3125+ ResolveDocLinks , SourceFileHashAlgorithm , SplitDwarfKind , SwitchWithOptPath ,
3126+ SymbolManglingVersion , TraitSolver , TrimmedDefPaths ,
31273127 } ;
31283128 use crate :: lint;
31293129 use crate :: options:: WasiExecModel ;
@@ -3227,6 +3227,7 @@ pub(crate) mod dep_tracking {
32273227 OomStrategy ,
32283228 LanguageIdentifier ,
32293229 TraitSolver ,
3230+ Polonius ,
32303231 ) ;
32313232
32323233 impl < T1 , T2 > DepTrackingHash for ( T1 , T2 )
@@ -3365,3 +3366,30 @@ impl DumpMonoStatsFormat {
33653366 }
33663367 }
33673368}
3369+
3370+ /// `-Zpolonius` values, enabling the borrow checker polonius analysis, and which version: legacy,
3371+ /// or future prototype.
3372+ #[ derive( Clone , Copy , PartialEq , Hash , Debug ) ]
3373+ pub enum Polonius {
3374+ /// The default value: disabled.
3375+ Off ,
3376+
3377+ /// Legacy version, using datalog and the `polonius-engine` crate. Historical value for `-Zpolonius`.
3378+ Legacy ,
3379+
3380+ /// In-tree experimentation
3381+ Next ,
3382+ }
3383+
3384+ impl Default for Polonius {
3385+ fn default ( ) -> Self {
3386+ Polonius :: Off
3387+ }
3388+ }
3389+
3390+ impl Polonius {
3391+ /// Returns whether the legacy version of polonius is enabled
3392+ pub fn is_legacy_enabled ( & self ) -> bool {
3393+ matches ! ( self , Polonius :: Legacy )
3394+ }
3395+ }
0 commit comments