@@ -28,7 +28,7 @@ use rustc::session::config::{OutputType, OutputTypes, Externs};
28
28
use rustc:: session:: search_paths:: { SearchPaths , PathKind } ;
29
29
use rustc_metadata:: dynamic_lib:: DynamicLibrary ;
30
30
use tempdir:: TempDir ;
31
- use rustc_driver:: { self , driver, Compilation } ;
31
+ use rustc_driver:: { self , driver, target_features , Compilation } ;
32
32
use rustc_driver:: driver:: phase_2_configure_and_expand;
33
33
use rustc_metadata:: cstore:: CStore ;
34
34
use rustc_resolve:: MakeGlobMap ;
@@ -96,8 +96,10 @@ pub fn run(input_path: &Path,
96
96
let trans = rustc_driver:: get_trans ( & sess) ;
97
97
let cstore = CStore :: new ( trans. metadata_loader ( ) ) ;
98
98
rustc_lint:: register_builtins ( & mut sess. lint_store . borrow_mut ( ) , Some ( & sess) ) ;
99
- sess. parse_sess . config =
100
- config:: build_configuration ( & sess, config:: parse_cfgspecs ( cfgs. clone ( ) ) ) ;
99
+
100
+ let mut cfg = config:: build_configuration ( & sess, config:: parse_cfgspecs ( cfgs. clone ( ) ) ) ;
101
+ target_features:: add_configuration ( & mut cfg, & sess, & * trans) ;
102
+ sess. parse_sess . config = cfg;
101
103
102
104
let krate = panictry ! ( driver:: phase_1_parse_input( & driver:: CompileController :: basic( ) ,
103
105
& sess,
@@ -271,8 +273,11 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
271
273
let outdir = Mutex :: new ( TempDir :: new ( "rustdoctest" ) . ok ( ) . expect ( "rustdoc needs a tempdir" ) ) ;
272
274
let libdir = sess. target_filesearch ( PathKind :: All ) . get_lib_path ( ) ;
273
275
let mut control = driver:: CompileController :: basic ( ) ;
274
- sess. parse_sess . config =
275
- config:: build_configuration ( & sess, config:: parse_cfgspecs ( cfgs. clone ( ) ) ) ;
276
+
277
+ let mut cfg = config:: build_configuration ( & sess, config:: parse_cfgspecs ( cfgs. clone ( ) ) ) ;
278
+ target_features:: add_configuration ( & mut cfg, & sess, & * trans) ;
279
+ sess. parse_sess . config = cfg;
280
+
276
281
let out = Some ( outdir. lock ( ) . unwrap ( ) . path ( ) . to_path_buf ( ) ) ;
277
282
278
283
if no_run {
0 commit comments