2018-12-16 22:21:47 -05:00
|
|
|
struct Dog {
|
2015-01-08 22:02:42 +11:00
|
|
|
food: usize,
|
2012-09-07 19:04:40 -07:00
|
|
|
}
|
2012-05-19 10:31:48 -07:00
|
|
|
|
2018-12-16 22:21:47 -05:00
|
|
|
impl Dog {
|
2013-05-31 15:17:22 -07:00
|
|
|
pub fn chase_cat(&mut self) {
|
2015-02-01 12:44:15 -05:00
|
|
|
let _f = || {
|
2022-04-19 12:56:18 +02:00
|
|
|
let p: &'static mut usize = &mut self.food;
|
2022-04-01 13:13:25 -04:00
|
|
|
//~^ ERROR lifetime may not live long enough
|
|
|
|
//~^^ ERROR lifetime may not live long enough
|
|
|
|
//~^^^ ERROR E0597
|
2015-03-03 10:42:26 +02:00
|
|
|
*p = 3;
|
2013-08-01 18:35:46 -04:00
|
|
|
};
|
2012-05-19 10:31:48 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2012-07-26 08:51:57 -07:00
|
|
|
}
|