mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Make macro def krate mandatory
Refactors builtin derive support to go through proper name resolution
This commit is contained in:
parent
c31c3246a8
commit
b238ddd21a
14 changed files with 91 additions and 42 deletions
|
@ -970,7 +970,7 @@ impl MacroDef {
|
|||
/// defines this macro. The reasons for this is that macros are expanded
|
||||
/// early, in `hir_expand`, where modules simply do not exist yet.
|
||||
pub fn module(self, db: &dyn HirDatabase) -> Option<Module> {
|
||||
let krate = self.id.krate?;
|
||||
let krate = self.id.krate;
|
||||
let module_id = db.crate_def_map(krate).root;
|
||||
Some(Module::new(Crate { id: krate }, module_id))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue