2019-10-31 16:02:02 +00:00
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
2021-01-01 15:59:59 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:35:5
|
2019-10-31 16:02:02 +00:00
|
|
|
|
|
|
|
|
LL | a.i = 42;
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::field-reassign-with-default` implied by `-D warnings`
|
|
|
|
note: consider initializing the variable with `A { i: 42, ..Default::default() }` and removing relevant reassignments
|
2021-01-01 15:59:59 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:34:5
|
2019-10-31 16:02:02 +00:00
|
|
|
|
|
|
|
|
LL | let mut a: A = Default::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
2021-01-01 15:59:59 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:75:5
|
2019-10-31 16:02:02 +00:00
|
|
|
|
|
|
|
|
LL | a.j = 43;
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: consider initializing the variable with `A { j: 43, i: 42 }` and removing relevant reassignments
|
2021-01-01 15:59:59 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:74:5
|
2019-10-31 16:02:02 +00:00
|
|
|
|
|
|
|
|
LL | let mut a: A = Default::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
2021-01-01 15:59:59 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:80:5
|
2019-10-31 16:02:02 +00:00
|
|
|
|
|
|
|
|
LL | a.i = 42;
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: consider initializing the variable with `A { i: 42, j: 44 }` and removing relevant reassignments
|
2021-01-01 15:59:59 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:79:5
|
2019-10-31 16:02:02 +00:00
|
|
|
|
|
|
|
|
LL | let mut a: A = Default::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
2021-01-01 15:59:59 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:86:5
|
2019-10-31 16:02:02 +00:00
|
|
|
|
|
|
|
|
LL | a.i = 42;
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: consider initializing the variable with `A { i: 42, ..Default::default() }` and removing relevant reassignments
|
2021-01-01 15:59:59 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:85:5
|
2019-10-31 16:02:02 +00:00
|
|
|
|
|
|
|
|
LL | let mut a = A::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
2021-01-01 15:59:59 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:96:5
|
2019-10-31 16:02:02 +00:00
|
|
|
|
|
|
|
|
LL | a.i = Default::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2020-11-23 18:26:35 +00:00
|
|
|
note: consider initializing the variable with `A { i: Default::default(), ..Default::default() }` and removing relevant reassignments
|
2021-01-01 15:59:59 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:95:5
|
2019-10-31 16:02:02 +00:00
|
|
|
|
|
|
|
|
LL | let mut a: A = Default::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
2021-01-01 15:59:59 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:100:5
|
2019-10-31 16:02:02 +00:00
|
|
|
|
|
|
|
|
LL | a.i = Default::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2020-11-23 18:26:35 +00:00
|
|
|
note: consider initializing the variable with `A { i: Default::default(), j: 45 }` and removing relevant reassignments
|
2021-01-01 15:59:59 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:99:5
|
2019-10-31 16:02:02 +00:00
|
|
|
|
|
|
|
|
LL | let mut a: A = Default::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2021-01-01 15:59:59 +00:00
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
|
|
|
--> $DIR/field_reassign_with_default.rs:122:5
|
|
|
|
|
|
|
|
|
LL | a.i = vec![1];
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: consider initializing the variable with `C { i: vec![1], ..Default::default() }` and removing relevant reassignments
|
|
|
|
--> $DIR/field_reassign_with_default.rs:121:5
|
|
|
|
|
|
|
|
|
LL | let mut a: C = C::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to 7 previous errors
|
2019-10-31 16:02:02 +00:00
|
|
|
|