File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed 
bootstrap/src/core/build_steps 
tools/miri/cargo-miri/src Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -2755,6 +2755,10 @@ impl Step for Crate {
27552755            // `lib.rs` file, and a `lib.miri.rs` file exists in the same folder, we build that 
27562756            // instead. But crucially we only do that for the library, not the test builds. 
27572757            cargo. env ( "MIRI_REPLACE_LIBRS_IF_NOT_TEST" ,  "1" ) ; 
2758+             // std needs to be built with `-Zforce-unstable-if-unmarked`. For some reason the builder 
2759+             // does not set this directly, but relies on the rustc wrapper to set it, and we are not using 
2760+             // the wrapper -- hence we have to set it ourselves. 
2761+             cargo. rustflag ( "-Zforce-unstable-if-unmarked" ) ; 
27582762            cargo
27592763        }  else  { 
27602764            // Also prepare a sysroot for the target. 
Original file line number Diff line number Diff line change @@ -136,7 +136,9 @@ pub fn setup(
136136    // But keep the overflow checks, they are cheap. This completely overwrites flags 
137137    // the user might have set, which is consistent with normal `cargo build` that does 
138138    // not apply `RUSTFLAGS` to the sysroot either. 
139-     let  rustflags = & [ "-Cdebug-assertions=off" ,  "-Coverflow-checks=on" ] ; 
139+     // We also need to set `force-unstable-if-unmarked` to ensure the sysroot builds. 
140+     let  rustflags =
141+         & [ "-Cdebug-assertions=off" ,  "-Coverflow-checks=on" ,  "-Zforce-unstable-if-unmarked" ] ; 
140142
141143    let  mut  after_build_output = String :: new ( ) ;  // what should be printed when the build is done. 
142144    let  notify = || { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments