@@ -241,6 +241,7 @@ fn run_compiler(
241241 mut args : Vec < String > ,
242242 target_crate : bool ,
243243 callbacks : & mut ( dyn rustc_driver:: Callbacks + Send ) ,
244+ using_internal_features : std:: sync:: Arc < std:: sync:: atomic:: AtomicBool > ,
244245) -> ! {
245246 if target_crate {
246247 // Miri needs a custom sysroot for target crates.
@@ -273,7 +274,9 @@ fn run_compiler(
273274
274275 // Invoke compiler, and handle return code.
275276 let exit_code = rustc_driver:: catch_with_exit_code ( move || {
276- rustc_driver:: RunCompiler :: new ( & args, callbacks) . run ( )
277+ rustc_driver:: RunCompiler :: new ( & args, callbacks)
278+ . set_using_internal_features ( using_internal_features)
279+ . run ( )
277280 } ) ;
278281 std:: process:: exit ( exit_code)
279282}
@@ -295,7 +298,8 @@ fn main() {
295298 // If the environment asks us to actually be rustc, then do that.
296299 if let Some ( crate_kind) = env:: var_os ( "MIRI_BE_RUSTC" ) {
297300 // Earliest rustc setup.
298- rustc_driver:: install_ice_hook ( rustc_driver:: DEFAULT_BUG_REPORT_URL , |_| ( ) ) ;
301+ let using_internal_features =
302+ rustc_driver:: install_ice_hook ( rustc_driver:: DEFAULT_BUG_REPORT_URL , |_| ( ) ) ;
299303 rustc_driver:: init_rustc_env_logger ( & handler) ;
300304
301305 let target_crate = if crate_kind == "target" {
@@ -311,11 +315,13 @@ fn main() {
311315 env:: args ( ) . collect ( ) ,
312316 target_crate,
313317 & mut MiriBeRustCompilerCalls { target_crate } ,
318+ using_internal_features,
314319 )
315320 }
316321
317322 // Add an ICE bug report hook.
318- rustc_driver:: install_ice_hook ( "https://github.com/rust-lang/miri/issues/new" , |_| ( ) ) ;
323+ let using_internal_features =
324+ rustc_driver:: install_ice_hook ( "https://github.com/rust-lang/miri/issues/new" , |_| ( ) ) ;
319325
320326 // Init loggers the Miri way.
321327 init_early_loggers ( & handler) ;
@@ -578,5 +584,10 @@ fn main() {
578584
579585 debug ! ( "rustc arguments: {:?}" , rustc_args) ;
580586 debug ! ( "crate arguments: {:?}" , miri_config. args) ;
581- run_compiler ( rustc_args, /* target_crate: */ true , & mut MiriCompilerCalls { miri_config } )
587+ run_compiler (
588+ rustc_args,
589+ /* target_crate: */ true ,
590+ & mut MiriCompilerCalls { miri_config } ,
591+ using_internal_features,
592+ )
582593}
0 commit comments