@@ -241,6 +241,7 @@ fn run_compiler(
241
241
mut args : Vec < String > ,
242
242
target_crate : bool ,
243
243
callbacks : & mut ( dyn rustc_driver:: Callbacks + Send ) ,
244
+ using_internal_features : std:: sync:: Arc < std:: sync:: atomic:: AtomicBool >
244
245
) -> ! {
245
246
if target_crate {
246
247
// Miri needs a custom sysroot for target crates.
@@ -273,7 +274,8 @@ fn run_compiler(
273
274
274
275
// Invoke compiler, and handle return code.
275
276
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) . run ( )
277
279
} ) ;
278
280
std:: process:: exit ( exit_code)
279
281
}
@@ -295,7 +297,7 @@ fn main() {
295
297
// If the environment asks us to actually be rustc, then do that.
296
298
if let Some ( crate_kind) = env:: var_os ( "MIRI_BE_RUSTC" ) {
297
299
// Earliest rustc setup.
298
- rustc_driver:: install_ice_hook ( rustc_driver:: DEFAULT_BUG_REPORT_URL , |_| ( ) ) ;
300
+ let using_internal_features = rustc_driver:: install_ice_hook ( rustc_driver:: DEFAULT_BUG_REPORT_URL , |_| ( ) ) ;
299
301
rustc_driver:: init_rustc_env_logger ( & handler) ;
300
302
301
303
let target_crate = if crate_kind == "target" {
@@ -311,11 +313,12 @@ fn main() {
311
313
env:: args ( ) . collect ( ) ,
312
314
target_crate,
313
315
& mut MiriBeRustCompilerCalls { target_crate } ,
316
+ using_internal_features,
314
317
)
315
318
}
316
319
317
320
// Add an ICE bug report hook.
318
- rustc_driver:: install_ice_hook ( "https://github.com/rust-lang/miri/issues/new" , |_| ( ) ) ;
321
+ let using_internal_features = rustc_driver:: install_ice_hook ( "https://github.com/rust-lang/miri/issues/new" , |_| ( ) ) ;
319
322
320
323
// Init loggers the Miri way.
321
324
init_early_loggers ( & handler) ;
@@ -578,5 +581,5 @@ fn main() {
578
581
579
582
debug ! ( "rustc arguments: {:?}" , rustc_args) ;
580
583
debug ! ( "crate arguments: {:?}" , miri_config. args) ;
581
- run_compiler ( rustc_args, /* target_crate: */ true , & mut MiriCompilerCalls { miri_config } )
584
+ run_compiler ( rustc_args, /* target_crate: */ true , & mut MiriCompilerCalls { miri_config } , using_internal_features )
582
585
}
0 commit comments