-// revisions: base nll
-// ignore-compare-mode-nll
-//[nll] compile-flags: -Z borrowck=mir
-
struct Dog {
food: usize,
}
pub fn chase_cat(&mut self) {
let _f = || {
let p: &'static mut usize = &mut self.food;
- //[base]~^ ERROR cannot infer
- //[nll]~^^ ERROR lifetime may not live long enough
- //[nll]~^^^ ERROR lifetime may not live long enough
- //[nll]~^^^^ ERROR E0597
+ //~^ ERROR lifetime may not live long enough
+ //~^^ ERROR lifetime may not live long enough
+ //~^^^ ERROR E0597
*p = 3;
};
}