summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/issue-98693.rs
blob: 7a325e2e998f36ce1161dfab0ba8fc80ffbfb4d3 (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>() {
    || {
        assert_static::<T>();
        //~^ ERROR the parameter type `T` may not live long enough
    };
}

fn main() {}