2022-05-21 14:22:42 -04:00
|
|
|
// ignore-compare-mode-nll
|
|
|
|
|
// revisions: base nll
|
|
|
|
|
// [nll]compile-flags: -Zborrowck=mir
|
|
|
|
|
|
2015-01-03 10:45:00 -05:00
|
|
|
fn bar<F>(blk: F) where F: FnOnce() + 'static {
|
2013-06-13 19:38:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn foo(x: &()) {
|
2015-08-07 13:23:11 -04:00
|
|
|
bar(|| {
|
2022-05-21 14:22:42 -04:00
|
|
|
//[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
|
|
|
|
|
//[nll]~^^ ERROR borrowed data escapes
|
|
|
|
|
//[nll]~| ERROR closure may outlive
|
2014-09-22 14:47:06 -04:00
|
|
|
let _ = x;
|
2013-11-21 17:23:21 -08:00
|
|
|
})
|
2013-06-13 19:38:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
}
|