1
Fork 0

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);

View file

@ -8,7 +8,6 @@ trait Foo {}
impl const Foo for () {}
fn foo<'a: 'a>() -> impl const Foo {}
//~^ ERROR ['a: o]
//~^ ERROR ['a: *]
fn main() {}

View file

@ -1,4 +1,4 @@
error: ['a: o]
error: ['a: *]
--> $DIR/variance.rs:10:21
|
LL | fn foo<'a: 'a>() -> impl const Foo {}