Skip to content

Commit 74eecf9

Browse files
committed
Use the non-embeddable (absolute) path to test relative remap of std
1 parent 67bd5f5 commit 74eecf9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

compiler/rustc_metadata/src/rmeta/decoder.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,15 +1669,14 @@ impl<'a> CrateMetadataRef<'a> {
16691669
for virtual_dir in virtual_source_base_dir.iter().flatten() {
16701670
if let Some(real_dir) = &real_source_base_dir
16711671
&& let rustc_span::FileName::Real(old_name) = name
1672-
&& let (_working_dir, embeddable_name) =
1673-
old_name.embeddable_name(RemapPathScopeComponents::MACRO)
1674-
&& let Ok(rest) = embeddable_name.strip_prefix(virtual_dir)
1672+
&& let virtual_path = old_name.path(RemapPathScopeComponents::MACRO)
1673+
&& let Ok(rest) = virtual_path.strip_prefix(virtual_dir)
16751674
{
16761675
let new_path = real_dir.join(rest);
16771676

16781677
debug!(
16791678
"try_to_translate_virtual_to_real: `{}` -> `{}`",
1680-
embeddable_name.display(),
1679+
virtual_path.display(),
16811680
new_path.display(),
16821681
);
16831682

0 commit comments

Comments
 (0)