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:
parent
7bf6fc16f2
commit
0bed12e02d
3 changed files with 6 additions and 3 deletions
|
@ -198,6 +198,10 @@ fn variance_of_opaque(
|
||||||
ty::ClauseKind::Trait(ty::TraitPredicate {
|
ty::ClauseKind::Trait(ty::TraitPredicate {
|
||||||
trait_ref: ty::TraitRef { def_id: _, args, .. },
|
trait_ref: ty::TraitRef { def_id: _, args, .. },
|
||||||
polarity: _,
|
polarity: _,
|
||||||
|
})
|
||||||
|
| ty::ClauseKind::HostEffect(ty::HostEffectPredicate {
|
||||||
|
trait_ref: ty::TraitRef { def_id: _, args, .. },
|
||||||
|
constness: _,
|
||||||
}) => {
|
}) => {
|
||||||
for arg in &args[1..] {
|
for arg in &args[1..] {
|
||||||
arg.visit_with(&mut collector);
|
arg.visit_with(&mut collector);
|
||||||
|
|
|
@ -8,7 +8,6 @@ trait Foo {}
|
||||||
impl const Foo for () {}
|
impl const Foo for () {}
|
||||||
|
|
||||||
fn foo<'a: 'a>() -> impl const Foo {}
|
fn foo<'a: 'a>() -> impl const Foo {}
|
||||||
//~^ ERROR ['a: o]
|
//~^ ERROR ['a: *]
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
error: ['a: o]
|
error: ['a: *]
|
||||||
--> $DIR/variance.rs:10:21
|
--> $DIR/variance.rs:10:21
|
||||||
|
|
|
|
||||||
LL | fn foo<'a: 'a>() -> impl const Foo {}
|
LL | fn foo<'a: 'a>() -> impl const Foo {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue