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