File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 11//! The entry point of the NLL borrow checker. 
22
3+ use  std:: io; 
34use  std:: path:: PathBuf ; 
45use  std:: rc:: Rc ; 
56use  std:: str:: FromStr ; 
6- use  std:: { env,  io} ; 
77
88use  polonius_engine:: { Algorithm ,  Output } ; 
99use  rustc_index:: IndexSlice ; 
@@ -163,8 +163,8 @@ pub(crate) fn compute_regions<'a, 'tcx>(
163163
164164        if  polonius_output { 
165165            let  algorithm =
166-                 env :: var ( "POLONIUS_ALGORITHM" ) . unwrap_or_else ( |_| String :: from ( "Hybrid" ) ) ; 
167-             let  algorithm = Algorithm :: from_str ( & algorithm) . unwrap ( ) ; 
166+                 infcx . tcx . env_var ( "POLONIUS_ALGORITHM" ) . unwrap_or_else ( |_| "Hybrid" . as_ref ( ) ) ; 
167+             let  algorithm = Algorithm :: from_str ( algorithm) . unwrap ( ) ; 
168168            debug ! ( "compute_regions: using polonius algorithm {:?}" ,  algorithm) ; 
169169            let  _prof_timer = infcx. tcx . prof . generic_activity ( "polonius_analysis" ) ; 
170170            Some ( Box :: new ( Output :: compute ( polonius_facts,  algorithm,  false ) ) ) 
Original file line number Diff line number Diff line change @@ -104,8 +104,10 @@ impl<'tcx> LateLintPass<'tcx> for NonLocalDefinitions {
104104        // determining if we are in a doctest context can't currently be determined 
105105        // by the code itself (there are no specific attributes), but fortunately rustdoc 
106106        // sets a perma-unstable env var for libtest so we just reuse that for now 
107-         let  is_at_toplevel_doctest =
108-             || self . body_depth  == 2  && std:: env:: var ( "UNSTABLE_RUSTDOC_TEST_PATH" ) . is_ok ( ) ; 
107+         let  is_at_toplevel_doctest = || { 
108+             self . body_depth  == 2 
109+                 && cx. tcx . env_var_os ( "UNSTABLE_RUSTDOC_TEST_PATH" . as_ref ( ) ) . is_some ( ) 
110+         } ; 
109111
110112        match  item. kind  { 
111113            ItemKind :: Impl ( impl_)  => { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments