rust/src/test/compile-fail/borrowck-mut-deref-comp.rs

9 lines
203 B
Rust
Raw Normal View History

enum foo = ~int;
fn borrow(x: @mut foo) {
let _y = &***x; //~ ERROR illegal borrow unless pure
*x = foo(~4); //~ NOTE impure due to assigning to dereference of mutable @ pointer
}
fn main() {
}