@@ -15,8 +15,8 @@ use rustc_session::config::{
1515use rustc_session:: lint:: Level ;
1616use rustc_session:: search_paths:: SearchPath ;
1717use rustc_session:: { EarlyDiagCtxt , getopts} ;
18- use rustc_span:: FileName ;
1918use rustc_span:: edition:: Edition ;
19+ use rustc_span:: { FileName , RemapPathScopeComponents } ;
2020use rustc_target:: spec:: TargetTuple ;
2121
2222use crate :: core:: new_dcx;
@@ -140,6 +140,8 @@ pub(crate) struct Options {
140140 pub ( crate ) no_run : bool ,
141141 /// What sources are being mapped.
142142 pub ( crate ) remap_path_prefix : Vec < ( PathBuf , PathBuf ) > ,
143+ /// Which scope(s) to use with `--remap-path-prefix`
144+ pub ( crate ) remap_path_scope : RemapPathScopeComponents ,
143145
144146 /// The path to a rustc-like binary to build tests with. If not set, we
145147 /// default to loading from `$sysroot/bin/rustc`.
@@ -222,6 +224,7 @@ impl fmt::Debug for Options {
222224 . field ( "no_run" , & self . no_run )
223225 . field ( "test_builder_wrappers" , & self . test_builder_wrappers )
224226 . field ( "remap-file-prefix" , & self . remap_path_prefix )
227+ . field ( "remap-file-scope" , & self . remap_path_scope )
225228 . field ( "no_capture" , & self . no_capture )
226229 . field ( "scrape_examples_options" , & self . scrape_examples_options )
227230 . field ( "unstable_features" , & self . unstable_features )
@@ -423,6 +426,8 @@ impl Options {
423426 early_dcx. early_fatal ( err) ;
424427 }
425428 } ;
429+ let remap_path_scope =
430+ rustc_session:: config:: parse_remap_path_scope ( early_dcx, matches, & unstable_opts) ;
426431
427432 let dcx = new_dcx ( error_format, None , diagnostic_width, & unstable_opts) ;
428433 let dcx = dcx. handle ( ) ;
@@ -889,6 +894,7 @@ impl Options {
889894 no_run,
890895 test_builder_wrappers,
891896 remap_path_prefix,
897+ remap_path_scope,
892898 no_capture,
893899 crate_name,
894900 output_format,
0 commit comments