File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ use rustc_mir_dataflow::move_paths::MoveData;
2222use rustc_mir_dataflow:: points:: DenseLocationMap ;
2323use rustc_session:: config:: MirIncludeSpans ;
2424use rustc_span:: symbol:: sym;
25+ use rustc_span:: Symbol ;
2526use tracing:: { debug, instrument} ;
2627
2728use crate :: borrow_set:: BorrowSet ;
@@ -179,9 +180,11 @@ pub(crate) fn compute_regions<'a, 'tcx>(
179180 }
180181
181182 if polonius_output {
182- let algorithm =
183- env:: var ( "POLONIUS_ALGORITHM" ) . unwrap_or_else ( |_| String :: from ( "Hybrid" ) ) ;
184- let algorithm = Algorithm :: from_str ( & algorithm) . unwrap ( ) ;
183+ let algorithm = infcx
184+ . tcx
185+ . env_var ( Symbol :: intern ( "POLONIUS_ALGORITHM" ) )
186+ . unwrap_or_else ( || Symbol :: intern ( "Hybrid" ) ) ;
187+ let algorithm = Algorithm :: from_str ( algorithm. as_str ( ) ) . unwrap ( ) ;
185188 debug ! ( "compute_regions: using polonius algorithm {:?}" , algorithm) ;
186189 let _prof_timer = infcx. tcx . prof . generic_activity ( "polonius_analysis" ) ;
187190 Some ( Rc :: new ( Output :: compute ( all_facts, algorithm, false ) ) )
Original file line number Diff line number Diff line change @@ -105,8 +105,10 @@ impl<'tcx> LateLintPass<'tcx> for NonLocalDefinitions {
105105 // determining if we are in a doctest context can't currently be determined
106106 // by the code itself (there are no specific attributes), but fortunately rustdoc
107107 // sets a perma-unstable env var for libtest so we just reuse that for now
108- let is_at_toplevel_doctest =
109- || self . body_depth == 2 && std:: env:: var ( "UNSTABLE_RUSTDOC_TEST_PATH" ) . is_ok ( ) ;
108+ let is_at_toplevel_doctest = || {
109+ self . body_depth == 2
110+ && cx. tcx . env_var ( Symbol :: intern ( "UNSTABLE_RUSTDOC_TEST_PATH" ) ) . is_some ( )
111+ } ;
110112
111113 match item. kind {
112114 ItemKind :: Impl ( impl_) => {
You can’t perform that action at this time.
0 commit comments