about summary refs log tree commit diff
path: root/tests/ui/borrowck/liberated-region-from-outer-closure.rs
blob: dcc6370b4a12a5fb505be029834310e3cb781a70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// Regression test for <https://github.com/rust-lang/rust/issues/144608>.

fn example<T: Copy>(x: T) -> impl FnMut(&mut ()) {
    move |_: &mut ()| {
        move || needs_static_lifetime(x);
        //~^ ERROR the parameter type `T` may not live long enough
    }
}

fn needs_static_lifetime<T: 'static>(obj: T) {}

fn main() {}