]> git.lizzy.rs Git - rust.git/blob - src/test/ui/did_you_mean/issue-35937.stderr
Auto merge of #43488 - Florob:repeat-opt, r=arielb1
[rust.git] / src / test / ui / did_you_mean / issue-35937.stderr
1 error[E0596]: cannot borrow immutable field `f.v` as mutable
2   --> $DIR/issue-35937.rs:17:5
3    |
4 16 |     let f = Foo { v: Vec::new() };
5    |         - consider changing this to `mut f`
6 17 |     f.v.push("cat".to_string());
7    |     ^^^ cannot mutably borrow immutable field
8
9 error[E0594]: cannot assign to immutable field `s.x`
10   --> $DIR/issue-35937.rs:26:5
11    |
12 25 |     let s = S { x: 42 };
13    |         - consider changing this to `mut s`
14 26 |     s.x += 1;
15    |     ^^^^^^^^ cannot mutably borrow immutable field
16
17 error[E0594]: cannot assign to immutable field `s.x`
18   --> $DIR/issue-35937.rs:30:5
19    |
20 29 | fn bar(s: S) {
21    |        - consider changing this to `mut s`
22 30 |     s.x += 1;
23    |     ^^^^^^^^ cannot mutably borrow immutable field
24
25 error: aborting due to 3 previous errors
26