]>
Commit | Line | Data |
---|---|---|
923072b8 FG |
1 | // Regression test for #98693. |
2 | // | |
3 | // The closure encounters an obligation that `T` must outlive `!U1`, | |
4 | // a placeholder from universe U1. We were ignoring this placeholder | |
5 | // when promoting the constraint to the enclosing function, and | |
6 | // thus incorrectly judging the closure to be safe. | |
7 | ||
8 | fn assert_static<T>() | |
9 | where | |
10 | for<'a> T: 'a, | |
11 | { | |
12 | } | |
13 | ||
14 | fn test<T>() { | |
15 | || { | |
923072b8 | 16 | assert_static::<T>(); |
487cf647 | 17 | //~^ ERROR the parameter type `T` may not live long enough |
923072b8 FG |
18 | }; |
19 | } | |
20 | ||
21 | fn main() {} |