mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Use QuantifiedWhereClause in generic_predicates as well
Still far too much binder skipping going on; I find it hard to imagine this is all correct, but the tests pass.
This commit is contained in:
parent
590c416359
commit
1d5c4a77fb
9 changed files with 28 additions and 37 deletions
|
@ -581,7 +581,7 @@ impl HirDisplay for Ty {
|
|||
.generic_predicates(id.parent)
|
||||
.into_iter()
|
||||
.map(|pred| pred.clone().subst(&substs))
|
||||
.filter(|wc| match &wc {
|
||||
.filter(|wc| match &wc.skip_binders() {
|
||||
WhereClause::Implemented(tr) => tr.self_type_parameter() == self,
|
||||
WhereClause::AliasEq(AliasEq {
|
||||
alias: AliasTy::Projection(proj),
|
||||
|
@ -590,15 +590,7 @@ impl HirDisplay for Ty {
|
|||
_ => false,
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
write_bounds_like_dyn_trait_with_prefix(
|
||||
"impl",
|
||||
&bounds
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(crate::Binders::wrap_empty)
|
||||
.collect::<Vec<_>>(),
|
||||
f,
|
||||
)?;
|
||||
write_bounds_like_dyn_trait_with_prefix("impl", &bounds, f)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue