1
Fork 0

mark issue-91139 and issue-92096 as FIXME

These were "fixed" as part of switching on NLL but seems
to be due to another problem. Preliminary investigation
suggests they are both PROBABLY "implied bounds" related.
This commit is contained in:
Niko Matsakis 2022-06-15 10:49:09 -04:00
parent 12912b9cde
commit ad25ee09c7
4 changed files with 82 additions and 3 deletions

View file

@ -1,5 +1,3 @@
//check-pass
#![feature(generic_associated_types)]
trait Foo<T> {
@ -16,6 +14,22 @@ impl<T> Foo<T> for () {
fn foo<T>() {
let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
//~^ ERROR `T` does not live long enough
//~| ERROR `T` does not live long enough
//~| ERROR `T` does not live long enough
//~| ERROR `T` does not live long enough
//~| ERROR `T` does not live long enough
//~| ERROR `T` does not live long enough
//~| ERROR `T` does not live long enough
//~| ERROR `T` does not live long enough
//
// FIXME: This error is bogus, but it arises because we try to validate
// that `<() as Foo<T>>::Type<'a>` is valid, which requires proving
// that `T: 'a`. Since `'a` is higher-ranked, this becomes
// `for<'a> T: 'a`, which is not true. Of course, the error is bogus
// because there *ought* to be an implied bound stating that `'a` is
// not any lifetime but specifically
// "some `'a` such that `<() as Foo<T>>::Type<'a>" is valid".
}
pub fn main() {}

View file

@ -0,0 +1,50 @@
error: `T` does not live long enough
--> $DIR/issue-91139.rs:16:12
|
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `T` does not live long enough
--> $DIR/issue-91139.rs:16:12
|
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `T` does not live long enough
--> $DIR/issue-91139.rs:16:12
|
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `T` does not live long enough
--> $DIR/issue-91139.rs:16:12
|
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `T` does not live long enough
--> $DIR/issue-91139.rs:16:58
|
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
| ^^^^^^^^^
error: `T` does not live long enough
--> $DIR/issue-91139.rs:16:58
|
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
| ^^^^^^^^^
error: `T` does not live long enough
--> $DIR/issue-91139.rs:16:58
|
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
| ^^^^^^^^^
error: `T` does not live long enough
--> $DIR/issue-91139.rs:16:58
|
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
| ^^^^^^^^^
error: aborting due to 8 previous errors

View file

@ -1,5 +1,4 @@
// edition:2018
// check-pass
#![feature(generic_associated_types)]
@ -18,6 +17,14 @@ where
C: Client + Send + Sync,
{
async move { c.connect().await }
//~^ ERROR `C` does not live long enough
//
// FIXME. This is because we infer at some point a value of
//
// impl Future<Output = <C as Client>::Connection<'_>>
//
// and then we somehow fail the WF check because `where C: 'a` is not known,
// but I'm not entirely sure how that comes about.
}
fn main() {}

View file

@ -0,0 +1,8 @@
error: `C` does not live long enough
--> $DIR/issue-92096.rs:19:5
|
LL | async move { c.connect().await }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error