Skip to content

Commit ad25ee0

Browse files
committed
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.
1 parent 12912b9 commit ad25ee0

File tree

4 files changed

+82
-3
lines changed

4 files changed

+82
-3
lines changed

src/test/ui/generic-associated-types/issue-91139.rs

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//check-pass
2-
31
#![feature(generic_associated_types)]
42

53
trait Foo<T> {
@@ -16,6 +14,22 @@ impl<T> Foo<T> for () {
1614

1715
fn foo<T>() {
1816
let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
17+
//~^ ERROR `T` does not live long enough
18+
//~| ERROR `T` does not live long enough
19+
//~| ERROR `T` does not live long enough
20+
//~| ERROR `T` does not live long enough
21+
//~| ERROR `T` does not live long enough
22+
//~| ERROR `T` does not live long enough
23+
//~| ERROR `T` does not live long enough
24+
//~| ERROR `T` does not live long enough
25+
//
26+
// FIXME: This error is bogus, but it arises because we try to validate
27+
// that `<() as Foo<T>>::Type<'a>` is valid, which requires proving
28+
// that `T: 'a`. Since `'a` is higher-ranked, this becomes
29+
// `for<'a> T: 'a`, which is not true. Of course, the error is bogus
30+
// because there *ought* to be an implied bound stating that `'a` is
31+
// not any lifetime but specifically
32+
// "some `'a` such that `<() as Foo<T>>::Type<'a>" is valid".
1933
}
2034

2135
pub fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
error: `T` does not live long enough
2+
--> $DIR/issue-91139.rs:16:12
3+
|
4+
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: `T` does not live long enough
8+
--> $DIR/issue-91139.rs:16:12
9+
|
10+
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
13+
error: `T` does not live long enough
14+
--> $DIR/issue-91139.rs:16:12
15+
|
16+
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18+
19+
error: `T` does not live long enough
20+
--> $DIR/issue-91139.rs:16:12
21+
|
22+
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
23+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24+
25+
error: `T` does not live long enough
26+
--> $DIR/issue-91139.rs:16:58
27+
|
28+
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
29+
| ^^^^^^^^^
30+
31+
error: `T` does not live long enough
32+
--> $DIR/issue-91139.rs:16:58
33+
|
34+
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
35+
| ^^^^^^^^^
36+
37+
error: `T` does not live long enough
38+
--> $DIR/issue-91139.rs:16:58
39+
|
40+
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
41+
| ^^^^^^^^^
42+
43+
error: `T` does not live long enough
44+
--> $DIR/issue-91139.rs:16:58
45+
|
46+
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
47+
| ^^^^^^^^^
48+
49+
error: aborting due to 8 previous errors
50+

src/test/ui/generic-associated-types/issue-92096.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// edition:2018
2-
// check-pass
32

43
#![feature(generic_associated_types)]
54

@@ -18,6 +17,14 @@ where
1817
C: Client + Send + Sync,
1918
{
2019
async move { c.connect().await }
20+
//~^ ERROR `C` does not live long enough
21+
//
22+
// FIXME. This is because we infer at some point a value of
23+
//
24+
// impl Future<Output = <C as Client>::Connection<'_>>
25+
//
26+
// and then we somehow fail the WF check because `where C: 'a` is not known,
27+
// but I'm not entirely sure how that comes about.
2128
}
2229

2330
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: `C` does not live long enough
2+
--> $DIR/issue-92096.rs:19:5
3+
|
4+
LL | async move { c.connect().await }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+

0 commit comments

Comments
 (0)