]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/reassignment_immutable_fields.nll.stderr
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / borrowck / reassignment_immutable_fields.nll.stderr
1 error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
2   --> $DIR/reassignment_immutable_fields.rs:17:5
3    |
4 LL |     let x: (u32, u32);
5    |         - help: consider changing this to be mutable: `mut x`
6 LL |     x.0 = 1; //~ ERROR
7    |     ^^^^^^^ cannot assign
8
9 error[E0594]: cannot assign to `x.1`, as `x` is not declared as mutable
10   --> $DIR/reassignment_immutable_fields.rs:18:5
11    |
12 LL |     let x: (u32, u32);
13    |         - help: consider changing this to be mutable: `mut x`
14 LL |     x.0 = 1; //~ ERROR
15 LL |     x.1 = 22; //~ ERROR
16    |     ^^^^^^^^ cannot assign
17
18 error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
19   --> $DIR/reassignment_immutable_fields.rs:25:5
20    |
21 LL |     let x: (u32, u32);
22    |         - help: consider changing this to be mutable: `mut x`
23 LL |     x.0 = 1; //~ ERROR
24    |     ^^^^^^^ cannot assign
25
26 error[E0594]: cannot assign to `x.1`, as `x` is not declared as mutable
27   --> $DIR/reassignment_immutable_fields.rs:26:5
28    |
29 LL |     let x: (u32, u32);
30    |         - help: consider changing this to be mutable: `mut x`
31 LL |     x.0 = 1; //~ ERROR
32 LL |     x.1 = 22; //~ ERROR
33    |     ^^^^^^^^ cannot assign
34
35 error[E0381]: use of possibly uninitialized variable: `x`
36   --> $DIR/reassignment_immutable_fields.rs:27:10
37    |
38 LL |     drop(x); //~ ERROR
39    |          ^ use of possibly uninitialized `x`
40
41 error: aborting due to 5 previous errors
42
43 Some errors occurred: E0381, E0594.
44 For more information about an error, try `rustc --explain E0381`.