]> git.proxmox.com Git - rustc.git/blame - src/test/ui/nll/issue-98693.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / nll / issue-98693.rs
CommitLineData
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
8fn assert_static<T>()
9where
10 for<'a> T: 'a,
11{
12}
13
14fn 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
21fn main() {}