Closed
Description
struct S { x: i32 }
let s = S { x: 42 };
s.x += 1; //~ERROR cannot assign to immutable field
It occurred to me that this might be confusing to newcomers because fields don't have mutability in Rust, instead we have inherited mutability. So maybe it should say "cannot assign to field of immutable struct" or "cannot modify field due to immutable binding" or something.
cf #18150