]> git.lizzy.rs Git - rust.git/blob - src/test/ui/did_you_mean/issue-35937.nll.stderr
Auto merge of #52046 - cramertj:fix-generator-mir, r=eddyb
[rust.git] / src / test / ui / did_you_mean / issue-35937.nll.stderr
1 error[E0596]: cannot borrow immutable item `f.v` as mutable
2   --> $DIR/issue-35937.rs:17:5
3    |
4 LL |     let f = Foo { v: Vec::new() };
5    |         - help: consider changing this to be mutable: `mut f`
6 LL |     f.v.push("cat".to_string()); //~ ERROR cannot borrow
7    |     ^^^ cannot borrow as mutable
8
9 error[E0384]: cannot assign twice to immutable variable `s`
10   --> $DIR/issue-35937.rs:26:5
11    |
12 LL |     let s = S { x: 42 };
13    |         -
14    |         |
15    |         first assignment to `s`
16    |         consider changing this to `mut s`
17 LL |     s.x += 1; //~ ERROR cannot assign
18    |     ^^^^^^^^ cannot assign twice to immutable variable
19
20 error[E0384]: cannot assign to immutable argument `s`
21   --> $DIR/issue-35937.rs:30:5
22    |
23 LL | fn bar(s: S) {
24    |        - consider changing this to `mut s`
25 LL |     s.x += 1; //~ ERROR cannot assign
26    |     ^^^^^^^^ cannot assign to immutable argument
27
28 error: aborting due to 3 previous errors
29
30 Some errors occurred: E0384, E0596.
31 For more information about an error, try `rustc --explain E0384`.