1error[E0596]: cannot borrow `f.v` as mutable, as `f` is not declared as mutable
2  --> $DIR/issue-35937.rs:7:5
3   |
4LL |     let f = Foo { v: Vec::new() };
5   |         - help: consider changing this to be mutable: `mut f`
6LL |     f.v.push("cat".to_string());
7   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable
8
9error[E0594]: cannot assign to `s.x`, as `s` is not declared as mutable
10  --> $DIR/issue-35937.rs:16:5
11   |
12LL |     let s = S { x: 42 };
13   |         - help: consider changing this to be mutable: `mut s`
14LL |     s.x += 1;
15   |     ^^^^^^^^ cannot assign
16
17error[E0594]: cannot assign to `s.x`, as `s` is not declared as mutable
18  --> $DIR/issue-35937.rs:20:5
19   |
20LL | fn bar(s: S) {
21   |        - help: consider changing this to be mutable: `mut s`
22LL |     s.x += 1;
23   |     ^^^^^^^^ cannot assign
24
25error: aborting due to 3 previous errors
26
27Some errors have detailed explanations: E0594, E0596.
28For more information about an error, try `rustc --explain E0594`.
29