hir_analysis: skip self type of host effect preds

Like trait predicates, the self type ought to be skipped here.
This commit is contained in:
David Wood 2025-02-24 09:50:22 +00:00
parent 7bf6fc16f2
commit 0bed12e02d
No known key found for this signature in database
3 changed files with 6 additions and 3 deletions

View file

@ -198,6 +198,10 @@ fn variance_of_opaque(
ty::ClauseKind::Trait(ty::TraitPredicate {
trait_ref: ty::TraitRef { def_id: _, args, .. },
polarity: _,
})
| ty::ClauseKind::HostEffect(ty::HostEffectPredicate {
trait_ref: ty::TraitRef { def_id: _, args, .. },
constness: _,
}) => {
for arg in &args[1..] {
arg.visit_with(&mut collector);