mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
feat: Downmap tokens inside derive helpers
This commit is contained in:
parent
7ba94a89e9
commit
4e60db2d07
9 changed files with 151 additions and 75 deletions
|
@ -448,10 +448,14 @@ impl Resolver {
|
|||
}
|
||||
|
||||
pub fn krate(&self) -> CrateId {
|
||||
self.def_map().krate()
|
||||
}
|
||||
|
||||
pub fn def_map(&self) -> &DefMap {
|
||||
self.scopes
|
||||
.get(0)
|
||||
.and_then(|scope| match scope {
|
||||
Scope::ModuleScope(m) => Some(m.def_map.krate()),
|
||||
Scope::ModuleScope(m) => Some(&m.def_map),
|
||||
_ => None,
|
||||
})
|
||||
.expect("module scope invariant violated")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue