Skip to content

Commit 919b391

Browse files
committed
Decrease the indentation in imported_source_file
1 parent 39cf520 commit 919b391

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

compiler/rustc_metadata/src/rmeta/decoder.rs

+10-13
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)