]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/reassignment_immutable_fields.stderr
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / borrowck / reassignment_immutable_fields.stderr
1 error[E0594]: cannot assign to field `x.0` of immutable binding
2   --> $DIR/reassignment_immutable_fields.rs:7:5
3    |
4 LL |     let x: (u32, u32);
5    |         - help: make this binding mutable: `mut x`
6 LL |     x.0 = 1; //~ ERROR
7    |     ^^^^^^^ cannot mutably borrow field of immutable binding
8
9 error[E0594]: cannot assign to field `x.1` of immutable binding
10   --> $DIR/reassignment_immutable_fields.rs:8:5
11    |
12 LL |     let x: (u32, u32);
13    |         - help: make this binding mutable: `mut x`
14 LL |     x.0 = 1; //~ ERROR
15 LL |     x.1 = 22; //~ ERROR
16    |     ^^^^^^^^ cannot mutably borrow field of immutable binding
17
18 error[E0381]: use of possibly uninitialized variable: `x.0`
19   --> $DIR/reassignment_immutable_fields.rs:9:10
20    |
21 LL |     drop(x.0); //~ ERROR
22    |          ^^^ use of possibly uninitialized `x.0`
23
24 error[E0381]: use of possibly uninitialized variable: `x.1`
25   --> $DIR/reassignment_immutable_fields.rs:10:10
26    |
27 LL |     drop(x.1); //~ ERROR
28    |          ^^^ use of possibly uninitialized `x.1`
29
30 error[E0594]: cannot assign to field `x.0` of immutable binding
31   --> $DIR/reassignment_immutable_fields.rs:15:5
32    |
33 LL |     let x: (u32, u32);
34    |         - help: make this binding mutable: `mut x`
35 LL |     x.0 = 1; //~ ERROR
36    |     ^^^^^^^ cannot mutably borrow field of immutable binding
37
38 error[E0594]: cannot assign to field `x.1` of immutable binding
39   --> $DIR/reassignment_immutable_fields.rs:16:5
40    |
41 LL |     let x: (u32, u32);
42    |         - help: make this binding mutable: `mut x`
43 LL |     x.0 = 1; //~ ERROR
44 LL |     x.1 = 22; //~ ERROR
45    |     ^^^^^^^^ cannot mutably borrow field of immutable binding
46
47 error[E0381]: use of possibly uninitialized variable: `x`
48   --> $DIR/reassignment_immutable_fields.rs:17:10
49    |
50 LL |     drop(x); //~ ERROR
51    |          ^ use of possibly uninitialized `x`
52
53 error: aborting due to 7 previous errors
54
55 Some errors occurred: E0381, E0594.
56 For more information about an error, try `rustc --explain E0381`.