2012-07-19 20:13:00 -07:00
|
|
|
enum foo = ~int;
|
|
|
|
|
|
|
|
fn borrow(x: @mut foo) {
|
2012-07-24 16:23:23 -07:00
|
|
|
let _y = &***x; //~ ERROR illegal borrow unless pure: creating immutable alias to aliasable, mutable memory
|
2012-07-19 20:13:00 -07:00
|
|
|
*x = foo(~4); //~ NOTE impure due to assigning to dereference of mutable @ pointer
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|