]>
Commit | Line | Data |
---|---|---|
f20569fa XL |
1 | error: field assignment outside of initializer for an instance created with Default::default() |
2 | --> $DIR/field_reassign_with_default.rs:48:5 | |
3 | | | |
4 | LL | a.i = 42; | |
5 | | ^^^^^^^^^ | |
6 | | | |
7 | = note: `-D clippy::field-reassign-with-default` implied by `-D warnings` | |
8 | note: consider initializing the variable with `main::A { i: 42, ..Default::default() }` and removing relevant reassignments | |
9 | --> $DIR/field_reassign_with_default.rs:47:5 | |
10 | | | |
11 | LL | let mut a: A = Default::default(); | |
12 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
13 | ||
14 | error: field assignment outside of initializer for an instance created with Default::default() | |
15 | --> $DIR/field_reassign_with_default.rs:88:5 | |
16 | | | |
17 | LL | a.j = 43; | |
18 | | ^^^^^^^^^ | |
19 | | | |
20 | note: consider initializing the variable with `main::A { j: 43, i: 42 }` and removing relevant reassignments | |
21 | --> $DIR/field_reassign_with_default.rs:87:5 | |
22 | | | |
23 | LL | let mut a: A = Default::default(); | |
24 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
25 | ||
26 | error: field assignment outside of initializer for an instance created with Default::default() | |
27 | --> $DIR/field_reassign_with_default.rs:93:5 | |
28 | | | |
29 | LL | a.i = 42; | |
30 | | ^^^^^^^^^ | |
31 | | | |
32 | note: consider initializing the variable with `main::A { i: 42, j: 44 }` and removing relevant reassignments | |
33 | --> $DIR/field_reassign_with_default.rs:92:5 | |
34 | | | |
35 | LL | let mut a: A = Default::default(); | |
36 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
37 | ||
38 | error: field assignment outside of initializer for an instance created with Default::default() | |
39 | --> $DIR/field_reassign_with_default.rs:99:5 | |
40 | | | |
41 | LL | a.i = 42; | |
42 | | ^^^^^^^^^ | |
43 | | | |
44 | note: consider initializing the variable with `main::A { i: 42, ..Default::default() }` and removing relevant reassignments | |
45 | --> $DIR/field_reassign_with_default.rs:98:5 | |
46 | | | |
47 | LL | let mut a = A::default(); | |
48 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
49 | ||
50 | error: field assignment outside of initializer for an instance created with Default::default() | |
51 | --> $DIR/field_reassign_with_default.rs:109:5 | |
52 | | | |
53 | LL | a.i = Default::default(); | |
54 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
55 | | | |
56 | note: consider initializing the variable with `main::A { i: Default::default(), ..Default::default() }` and removing relevant reassignments | |
57 | --> $DIR/field_reassign_with_default.rs:108:5 | |
58 | | | |
59 | LL | let mut a: A = Default::default(); | |
60 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
61 | ||
62 | error: field assignment outside of initializer for an instance created with Default::default() | |
63 | --> $DIR/field_reassign_with_default.rs:113:5 | |
64 | | | |
65 | LL | a.i = Default::default(); | |
66 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
67 | | | |
68 | note: consider initializing the variable with `main::A { i: Default::default(), j: 45 }` and removing relevant reassignments | |
69 | --> $DIR/field_reassign_with_default.rs:112:5 | |
70 | | | |
71 | LL | let mut a: A = Default::default(); | |
72 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
73 | ||
74 | error: field assignment outside of initializer for an instance created with Default::default() | |
75 | --> $DIR/field_reassign_with_default.rs:135:5 | |
76 | | | |
77 | LL | a.i = vec![1]; | |
78 | | ^^^^^^^^^^^^^^ | |
79 | | | |
80 | note: consider initializing the variable with `C { i: vec![1], ..Default::default() }` and removing relevant reassignments | |
81 | --> $DIR/field_reassign_with_default.rs:134:5 | |
82 | | | |
83 | LL | let mut a: C = C::default(); | |
84 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
85 | ||
86 | error: aborting due to 7 previous errors | |
87 |