]> git.lizzy.rs Git - rust.git/blob - tests/ui/did_you_mean/issue-35937.stderr
Rollup merge of #104965 - zacklukem:p-option-as_ref-docs, r=scottmcm
[rust.git] / tests / ui / did_you_mean / issue-35937.stderr
1 error[E0596]: cannot borrow `f.v` as mutable, as `f` is not declared as mutable
2   --> $DIR/issue-35937.rs:7:5
3    |
4 LL |     f.v.push("cat".to_string());
5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable
6    |
7 help: consider changing this to be mutable
8    |
9 LL |     let mut f = Foo { v: Vec::new() };
10    |         +++
11
12 error[E0594]: cannot assign to `s.x`, as `s` is not declared as mutable
13   --> $DIR/issue-35937.rs:16:5
14    |
15 LL |     s.x += 1;
16    |     ^^^^^^^^ cannot assign
17    |
18 help: consider changing this to be mutable
19    |
20 LL |     let mut s = S { x: 42 };
21    |         +++
22
23 error[E0594]: cannot assign to `s.x`, as `s` is not declared as mutable
24   --> $DIR/issue-35937.rs:20:5
25    |
26 LL |     s.x += 1;
27    |     ^^^^^^^^ cannot assign
28    |
29 help: consider changing this to be mutable
30    |
31 LL | fn bar(mut s: S) {
32    |        +++
33
34 error: aborting due to 3 previous errors
35
36 Some errors have detailed explanations: E0594, E0596.
37 For more information about an error, try `rustc --explain E0594`.