mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Remove another helper
This commit is contained in:
parent
25b32f9d68
commit
24b1e79af5
3 changed files with 27 additions and 25 deletions
|
@ -28,8 +28,8 @@ use crate::{
|
|||
expr::{BindingAnnotation, Body, BodySourceMap, ExprValidator, Pat, PatId},
|
||||
ty::display::HirFormatter,
|
||||
ty::{
|
||||
self, utils::all_super_traits, InEnvironment, InferenceResult, Namespace, TraitEnvironment,
|
||||
TraitRef, Ty, TypeCtor, TypeWalk,
|
||||
self, InEnvironment, InferenceResult, Namespace, TraitEnvironment, TraitRef, Ty, TypeCtor,
|
||||
TypeWalk,
|
||||
},
|
||||
CallableDef, Either, HirDisplay, Name, Source,
|
||||
};
|
||||
|
@ -740,17 +740,6 @@ impl Trait {
|
|||
db.trait_data(self.id).items.iter().map(|(_name, it)| (*it).into()).collect()
|
||||
}
|
||||
|
||||
pub fn associated_type_by_name_including_super_traits(
|
||||
self,
|
||||
db: &impl HirDatabase,
|
||||
name: &Name,
|
||||
) -> Option<TypeAlias> {
|
||||
all_super_traits(db, self.id)
|
||||
.into_iter()
|
||||
.find_map(|t| db.trait_data(t).associated_type_by_name(name))
|
||||
.map(TypeAlias::from)
|
||||
}
|
||||
|
||||
pub fn trait_ref(self, db: &impl HirDatabase) -> TraitRef {
|
||||
TraitRef::for_trait(db, self)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue