summary refs log tree commit diff
path: root/src/test/compile-fail/mutable-huh-field-assign.rs
blob: 44da70f463c340b0aebe822e78840df21aee966d (plain)
1
2
3
4
5
6
7
8
9
10
fn main() {
    fn f(&&v: {const field: int}) {
        // This shouldn't be possible
        v.field = 1 //~ ERROR assigning to const field
    }

    let v = {field: 0};

    f(v);
}