summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nll/issue-98693.rs
blob: 18e6ec630464657410329fb09e01c3d48387fcc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Regression test for #98693.
//
// The closure encounters an obligation that `T` must outlive `!U1`,
// a placeholder from universe U1. We were ignoring this placeholder
// when promoting the constraint to the enclosing function, and
// thus incorrectly judging the closure to be safe.

fn assert_static<T>()
where
    for<'a> T: 'a,
{
}

fn test<T>() {
    || {
        //~^ ERROR the parameter type `T` may not live long enough
        assert_static::<T>();
    };
}

fn main() {}