13 lines
201 B
Rust
13 lines
201 B
Rust
|
// error-pattern: assigning to immutable field
|
||
|
|
||
|
fn main() {
|
||
|
fn f(&&v: {mutable? field: int}) {
|
||
|
// This shouldn't be possible
|
||
|
v.field = 1
|
||
|
}
|
||
|
|
||
|
let v = {field: 0};
|
||
|
|
||
|
f(v);
|
||
|
}
|