@@ -23,8 +23,8 @@ use rustc_errors::registry::Registry;
2323use rustc_errors:: { Diagnostic , DiagnosticBuilder , DiagnosticId , ErrorReported } ;
2424use rustc_lint_defs:: FutureBreakage ;
2525pub use rustc_span:: crate_disambiguator:: CrateDisambiguator ;
26- use rustc_span:: edition:: Edition ;
2726use rustc_span:: source_map:: { FileLoader , MultiSpan , RealFileLoader , SourceMap , Span } ;
27+ use rustc_span:: { edition:: Edition , RealFileName } ;
2828use rustc_span:: { sym, SourceFileHashAlgorithm , Symbol } ;
2929use rustc_target:: asm:: InlineAsmArch ;
3030use rustc_target:: spec:: { CodeModel , PanicStrategy , RelocModel , RelroLevel } ;
@@ -125,9 +125,8 @@ pub struct Session {
125125 /// The name of the root source file of the crate, in the local file system.
126126 /// `None` means that there is no source file.
127127 pub local_crate_source_file : Option < PathBuf > ,
128- /// The directory the compiler has been executed in plus a flag indicating
129- /// if the value stored here has been affected by path remapping.
130- pub working_dir : ( PathBuf , bool ) ,
128+ /// The directory the compiler has been executed in
129+ pub working_dir : RealFileName ,
131130
132131 /// Set of `(DiagnosticId, Option<Span>, message)` tuples tracking
133132 /// (sub)diagnostics that have been set once, but should not be set again,
@@ -1361,7 +1360,12 @@ pub fn build_session(
13611360 let working_dir = env:: current_dir ( ) . unwrap_or_else ( |e| {
13621361 parse_sess. span_diagnostic . fatal ( & format ! ( "Current directory is invalid: {}" , e) ) . raise ( )
13631362 } ) ;
1364- let working_dir = file_path_mapping. map_prefix ( working_dir) ;
1363+ let ( path, remapped) = file_path_mapping. map_prefix ( working_dir. clone ( ) ) ;
1364+ let working_dir = if remapped {
1365+ RealFileName :: Remapped { local_path : Some ( working_dir) , virtual_name : path }
1366+ } else {
1367+ RealFileName :: LocalPath ( path)
1368+ } ;
13651369
13661370 let cgu_reuse_tracker = if sopts. debugging_opts . query_dep_graph {
13671371 CguReuseTracker :: new ( )
0 commit comments