Remove built-in Unsize impls
They exist in Chalk now.
This commit is contained in:
@@ -110,38 +110,6 @@ pub(super) fn all_super_trait_refs(db: &dyn HirDatabase, trait_ref: TraitRef) ->
|
||||
result
|
||||
}
|
||||
|
||||
/// Finds a path from a trait to one of its super traits. Returns an empty
|
||||
/// vector if there is no path.
|
||||
pub(super) fn find_super_trait_path(
|
||||
db: &dyn DefDatabase,
|
||||
trait_: TraitId,
|
||||
super_trait: TraitId,
|
||||
) -> Vec<TraitId> {
|
||||
let mut result = Vec::with_capacity(2);
|
||||
result.push(trait_);
|
||||
return if go(db, super_trait, &mut result) { result } else { Vec::new() };
|
||||
|
||||
fn go(db: &dyn DefDatabase, super_trait: TraitId, path: &mut Vec<TraitId>) -> bool {
|
||||
let trait_ = *path.last().unwrap();
|
||||
if trait_ == super_trait {
|
||||
return true;
|
||||
}
|
||||
|
||||
for tt in direct_super_traits(db, trait_) {
|
||||
if path.contains(&tt) {
|
||||
continue;
|
||||
}
|
||||
path.push(tt);
|
||||
if go(db, super_trait, path) {
|
||||
return true;
|
||||
} else {
|
||||
path.pop();
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn associated_type_by_name_including_super_traits(
|
||||
db: &dyn HirDatabase,
|
||||
trait_ref: TraitRef,
|
||||
|
||||
Reference in New Issue
Block a user