File tree 1 file changed +10
-13
lines changed
compiler/rustc_metadata/src/rmeta
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> {
1467
1467
// `try_to_translate_virtual_to_real` don't have to worry about how the
1468
1468
// compiler is bootstrapped.
1469
1469
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 ;
1483
1480
}
1484
1481
}
1485
1482
}
You can’t perform that action at this time.
0 commit comments