rust/src/test/compile-fail/mutable-huh-unique-assign.rs
2011-11-16 14:41:32 -08:00

13 lines
175 B
Rust

// error-pattern: assigning to immutable box
fn main() {
fn f(&&v: ~const int) {
// This shouldn't be possible
*v = 1
}
let v = ~0;
f(v);
}