blob: c9e043577ed6d90b652644371c59fb02a11b6b7b (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
type Lazy<T> = Box<dyn Fn() -> T + 'static>;
fn test(x: &i32) -> Lazy<i32> {
Box::new(|| {
//~^ ERROR lifetime may not live long enough
//~| ERROR closure may outlive the current function
*x
})
}
fn main() {}
|