Skip to content
/ rust Public
forked from rust-lang/rust

Commit 16729bc

Browse files
committed
resolve: Set correct parent and expansion for self declarations
1 parent 4a997ee commit 16729bc

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

  • compiler/rustc_resolve/src

compiler/rustc_resolve/src/lib.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,13 +1548,10 @@ impl<'ra> ResolverArenas<'ra> {
15481548
no_implicit_prelude: bool,
15491549
) -> Module<'ra> {
15501550
let self_decl = match kind {
1551-
ModuleKind::Def(def_kind, def_id, _, _) => Some(self.new_def_decl(
1552-
Res::Def(def_kind, def_id),
1553-
vis,
1554-
span,
1555-
LocalExpnId::ROOT,
1556-
None,
1557-
)),
1551+
ModuleKind::Def(def_kind, def_id, _, _) => {
1552+
let expn_id = expn_id.as_local().unwrap_or(LocalExpnId::ROOT);
1553+
Some(self.new_def_decl(Res::Def(def_kind, def_id), vis, span, expn_id, parent))
1554+
}
15581555
ModuleKind::Block => None,
15591556
};
15601557
Module(Interned::new_unchecked(self.modules.alloc(ModuleData::new(

0 commit comments

Comments
 (0)