@@ -395,7 +395,8 @@ top_level_options!(
395395 output_types: OutputTypes [ TRACKED ] ,
396396 search_paths: Vec <SearchPath > [ UNTRACKED ] ,
397397 libs: Vec <( String , Option <String >, Option <cstore:: NativeLibraryKind >) > [ TRACKED ] ,
398- maybe_sysroot: Option <PathBuf > [ TRACKED ] ,
398+ maybe_sysroot: Option <PathBuf > [ UNTRACKED ] ,
399+ maybe_sysroot_remapped: Option <PathBuf > [ TRACKED ] ,
399400
400401 target_triple: TargetTriple [ TRACKED ] ,
401402
@@ -610,6 +611,7 @@ impl Default for Options {
610611 output_types : OutputTypes ( BTreeMap :: new ( ) ) ,
611612 search_paths : vec ! [ ] ,
612613 maybe_sysroot : None ,
614+ maybe_sysroot_remapped : None ,
613615 target_triple : TargetTriple :: from_triple ( host_triple ( ) ) ,
614616 test : false ,
615617 incremental : None ,
@@ -2453,7 +2455,7 @@ pub fn build_session_options_and_crate_config(
24532455
24542456 let crate_name = matches. opt_str ( "crate-name" ) ;
24552457
2456- let remap_path_prefix = matches
2458+ let remap_path_prefix: Vec < ( PathBuf , PathBuf ) > = matches
24572459 . opt_strs ( "remap-path-prefix" )
24582460 . into_iter ( )
24592461 . map ( |remap| {
@@ -2470,6 +2472,10 @@ pub fn build_session_options_and_crate_config(
24702472 } )
24712473 . collect ( ) ;
24722474
2475+ let sysroot_remapped_opt = sysroot_opt
2476+ . clone ( )
2477+ . map ( |sysroot| FilePathMapping :: new ( remap_path_prefix. clone ( ) ) . map_prefix ( sysroot) . 0 ) ;
2478+
24732479 (
24742480 Options {
24752481 crate_types,
@@ -2481,6 +2487,7 @@ pub fn build_session_options_and_crate_config(
24812487 output_types : OutputTypes ( output_types) ,
24822488 search_paths,
24832489 maybe_sysroot : sysroot_opt,
2490+ maybe_sysroot_remapped : sysroot_remapped_opt,
24842491 target_triple,
24852492 test,
24862493 incremental,
0 commit comments