summary refs log tree commit diff
path: root/src/test/compile-fail/mutable-huh-box-assign.rs
blob: 1f06a82f9a608a3ab2ebb57d76ad673e56f98194 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// 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);
}