This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed
compiler/rustc_metadata/src/rmeta Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -1467,19 +1467,16 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
14671467 // `try_to_translate_virtual_to_real` don't have to worry about how the
14681468 // compiler is bootstrapped.
14691469 if let Some ( virtual_dir) = & sess. opts . unstable_opts . simulate_remapped_rust_src_base
1470- {
1471- if let Some ( real_dir) = & sess. opts . real_rust_source_base_dir {
1472- for subdir in [ "library" , "compiler" ] {
1473- if let rustc_span:: FileName :: Real ( ref mut old_name) = name {
1474- if let rustc_span:: RealFileName :: LocalPath ( local) = old_name {
1475- if let Ok ( rest) = local. strip_prefix ( real_dir. join ( subdir) ) {
1476- * old_name = rustc_span:: RealFileName :: Remapped {
1477- local_path : None ,
1478- virtual_name : virtual_dir. join ( subdir) . join ( rest) ,
1479- } ;
1480- }
1481- }
1482- }
1470+ && let Some ( real_dir) = & sess. opts . real_rust_source_base_dir
1471+ && let rustc_span:: FileName :: Real ( ref mut old_name) = name
1472+ && let rustc_span:: RealFileName :: LocalPath ( local) = old_name {
1473+ for subdir in [ "library" , "compiler" ] {
1474+ if let Ok ( rest) = local. strip_prefix ( real_dir. join ( subdir) ) {
1475+ * old_name = rustc_span:: RealFileName :: Remapped {
1476+ local_path : None ,
1477+ virtual_name : virtual_dir. join ( subdir) . join ( rest) ,
1478+ } ;
1479+ break ;
14831480 }
14841481 }
14851482 }
You can’t perform that action at this time.
0 commit comments