summary refs log tree commit diff
path: root/src/test/compile-fail/mutable-huh-field-assign.rs
blob: 0aee89fb6307333a2e2caa891fa700f079462211 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// error-pattern: assigning to immutable field

fn main() {
    fn f(&&v: {const field: int}) {
        // This shouldn't be possible
        v.field = 1
    }

    let v = {field: 0};

    f(v);
}