mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-15 01:55:03 +00:00
12 lines
230 B
Rust
12 lines
230 B
Rust
fn some_fn<'a>(_: &'a i32, _: impl FnOnce(&'a i32)) {}
|
|
|
|
fn main() {
|
|
let some_closure = |_| {};
|
|
|
|
for a in [1] {
|
|
some_fn(&a, |c| { //~ ERROR does not live long enough
|
|
some_closure(c);
|
|
});
|
|
}
|
|
}
|