]> git.lizzy.rs Git - rust.git/blob - tests/ui/span/regionck-unboxed-closure-lifetimes.rs
Rollup merge of #106441 - mllken:abstract-socket-noref, r=joshtriplett
[rust.git] / tests / ui / span / regionck-unboxed-closure-lifetimes.rs
1 #![feature(rustc_attrs)]
2 use std::ops::FnMut;
3
4 fn main() { #![rustc_error] // rust-lang/rust#49855
5     let mut f;
6     {
7         let c = 1;
8         let c_ref = &c;
9         //~^ ERROR `c` does not live long enough
10         f = move |a: isize, b: isize| { a + b + *c_ref };
11     }
12     f.use_mut();
13 }
14
15 trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { }  }
16 impl<T> Fake for T { }