rust/src/test/compile-fail/regions-addr-of-upvar-self.rs

14 lines
232 B
Rust
Raw Normal View History

2012-08-15 20:46:55 -05:00
struct dog {
let mut food: uint;
fn chase_cat() {
for uint::range(0u, 10u) |_i| {
let p: &static/mut uint = &mut self.food; //~ ERROR illegal borrow
*p = 3u;
}
}
}
fn main() {
}