mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Specify desirable namespace when calling resolve
That way, we are able to get rid of a number of unreachable statements
This commit is contained in:
parent
1adf0519bc
commit
51e2d76b98
13 changed files with 542 additions and 472 deletions
|
@ -22,7 +22,7 @@ use crate::{
|
|||
U8, USIZE,
|
||||
},
|
||||
nameres::{CrateModuleId, ImportId, ModuleScope, Namespace},
|
||||
resolve::Resolver,
|
||||
resolve::{Resolver, TypeNs},
|
||||
traits::{TraitData, TraitItem},
|
||||
ty::{
|
||||
primitive::{FloatBitness, FloatTy, IntBitness, IntTy, Signedness},
|
||||
|
@ -868,11 +868,9 @@ impl Trait {
|
|||
}
|
||||
_ => None,
|
||||
})
|
||||
.filter_map(|path| {
|
||||
match resolver.resolve_path_without_assoc_items(db, path).take_types() {
|
||||
Some(crate::Resolution::Def(ModuleDef::Trait(t))) => Some(t),
|
||||
_ => None,
|
||||
}
|
||||
.filter_map(|path| match resolver.resolve_path_in_type_ns_fully(db, path) {
|
||||
Some(TypeNs::Trait(t)) => Some(t),
|
||||
_ => None,
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue