mirror of
https://github.com/rust-lang/rust.git
synced 2025-09-30 08:16:56 +00:00
13 lines
330 B
Rust
13 lines
330 B
Rust
// 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() {}
|