Skip to content

Commit 4463132

Browse files
committed
Don't update directory path for inline mods during macro expansion
1 parent 1da1399 commit 4463132

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/libsyntax/ext/expand.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,14 +1355,10 @@ impl<'a, 'b> Folder for InvocationCollector<'a, 'b> {
13551355
let inline_module = item.span.contains(inner) || inner.is_dummy();
13561356

13571357
if inline_module {
1358-
if let Some(path) = attr::first_attr_value_str_by_name(&item.attrs, "path") {
1359-
orig_directory_ownership =
1360-
Some(mem::replace(
1361-
&mut self.cx.current_expansion.directory_ownership,
1362-
DirectoryOwnership::Owned { relative: vec![] }));
1363-
module.directory.push(&*path.as_str());
1364-
} else {
1365-
module.directory.push(&*item.ident.as_str());
1358+
if let DirectoryOwnership::Owned { relative } =
1359+
&mut self.directory.ownership
1360+
{
1361+
relative.push(item.ident);
13661362
}
13671363
} else {
13681364
let path = self.cx.parse_sess.source_map().span_to_unmapped_path(inner);

0 commit comments

Comments
 (0)