mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Rename shift_bound_vars{_out} to align with Chalk
This commit is contained in:
parent
fbab69cbff
commit
a316d58360
5 changed files with 32 additions and 25 deletions
|
@ -66,9 +66,11 @@ fn direct_super_trait_refs(db: &dyn HirDatabase, trait_ref: &TraitRef) -> Vec<Tr
|
|||
.filter_map(|pred| {
|
||||
pred.as_ref().filter_map(|pred| match pred.skip_binders() {
|
||||
// FIXME: how to correctly handle higher-ranked bounds here?
|
||||
WhereClause::Implemented(tr) => {
|
||||
Some(tr.clone().shift_bound_vars_out(DebruijnIndex::ONE))
|
||||
}
|
||||
WhereClause::Implemented(tr) => Some(
|
||||
tr.clone()
|
||||
.shifted_out_to(DebruijnIndex::ONE)
|
||||
.expect("FIXME unexpected higher-ranked trait bound"),
|
||||
),
|
||||
_ => None,
|
||||
})
|
||||
})
|
||||
|
@ -103,6 +105,8 @@ pub(super) fn all_super_traits(db: &dyn DefDatabase, trait_: TraitId) -> Vec<Tra
|
|||
/// we have `Self: Trait<u32, i32>` and `Trait<T, U>: OtherTrait<U>` we'll get
|
||||
/// `Self: OtherTrait<i32>`.
|
||||
pub(super) fn all_super_trait_refs(db: &dyn HirDatabase, trait_ref: TraitRef) -> Vec<TraitRef> {
|
||||
// FIXME: replace by Chalk's `super_traits`, maybe make this a query
|
||||
|
||||
// we need to take care a bit here to avoid infinite loops in case of cycles
|
||||
// (i.e. if we have `trait A: B; trait B: A;`)
|
||||
let mut result = vec![trait_ref];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue