resolve: Refactor obtaining Module
from its DefId
The `Option<Module>` version is supported for the case where we don't know whether the `DefId` refers to a module or not. Non-local traits and enums are also correctly found now.
This commit is contained in:
parent
a8021888c8
commit
ab834e5ea9
6 changed files with 76 additions and 78 deletions
|
@ -240,7 +240,7 @@ impl<'a> ResolverExpand for Resolver<'a> {
|
|||
);
|
||||
|
||||
let parent_scope =
|
||||
parent_module.map_or(self.empty_module, |def_id| self.get_module(def_id));
|
||||
parent_module.map_or(self.empty_module, |def_id| self.expect_module(def_id));
|
||||
self.ast_transform_scopes.insert(expn_id, parent_scope);
|
||||
|
||||
expn_id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue