2020-11-05 13:29:48 +00:00
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:56:5
|
2020-11-05 13:29:48 +00:00
|
|
|
|
|
|
|
|
LL | a.i = 42;
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
2021-01-15 09:56:44 +00:00
|
|
|
note: consider initializing the variable with `main::A { i: 42, ..Default::default() }` and removing relevant reassignments
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:55:5
|
2020-11-05 13:29:48 +00:00
|
|
|
|
|
|
|
|
LL | let mut a: A = Default::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-09-22 16:04:22 +00:00
|
|
|
= note: `-D clippy::field-reassign-with-default` implied by `-D warnings`
|
2020-11-05 13:29:48 +00:00
|
|
|
|
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:96:5
|
2020-11-05 13:29:48 +00:00
|
|
|
|
|
|
|
|
LL | a.j = 43;
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
2021-01-15 09:56:44 +00:00
|
|
|
note: consider initializing the variable with `main::A { j: 43, i: 42 }` and removing relevant reassignments
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:95:5
|
2020-11-05 13:29:48 +00:00
|
|
|
|
|
|
|
|
LL | let mut a: A = Default::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:101:5
|
2020-11-05 13:29:48 +00:00
|
|
|
|
|
|
|
|
LL | a.i = 42;
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
2021-01-15 09:56:44 +00:00
|
|
|
note: consider initializing the variable with `main::A { i: 42, j: 44 }` and removing relevant reassignments
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:100:5
|
2020-11-05 13:29:48 +00:00
|
|
|
|
|
|
|
|
LL | let mut a: A = Default::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:107:5
|
2020-11-05 13:29:48 +00:00
|
|
|
|
|
|
|
|
LL | a.i = 42;
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
2021-01-15 09:56:44 +00:00
|
|
|
note: consider initializing the variable with `main::A { i: 42, ..Default::default() }` and removing relevant reassignments
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:106:5
|
2020-11-05 13:29:48 +00:00
|
|
|
|
|
|
|
|
LL | let mut a = A::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:117:5
|
2020-11-05 13:29:48 +00:00
|
|
|
|
|
|
|
|
LL | a.i = Default::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2021-01-15 09:56:44 +00:00
|
|
|
note: consider initializing the variable with `main::A { i: Default::default(), ..Default::default() }` and removing relevant reassignments
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:116:5
|
2020-11-05 13:29:48 +00:00
|
|
|
|
|
|
|
|
LL | let mut a: A = Default::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:121:5
|
2020-11-05 13:29:48 +00:00
|
|
|
|
|
|
|
|
LL | a.i = Default::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2021-01-15 09:56:44 +00:00
|
|
|
note: consider initializing the variable with `main::A { i: Default::default(), j: 45 }` and removing relevant reassignments
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:120:5
|
2020-11-05 13:29:48 +00:00
|
|
|
|
|
|
|
|
LL | let mut a: A = Default::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2021-01-15 09:56:44 +00:00
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:143:5
|
2021-01-15 09:56:44 +00:00
|
|
|
|
|
|
|
|
LL | a.i = vec![1];
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: consider initializing the variable with `C { i: vec![1], ..Default::default() }` and removing relevant reassignments
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:142:5
|
2021-01-15 09:56:44 +00:00
|
|
|
|
|
|
|
|
LL | let mut a: C = C::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2021-03-25 18:29:11 +00:00
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:161:5
|
2021-03-25 18:29:11 +00:00
|
|
|
|
|
|
|
|
LL | a.i = true;
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: consider initializing the variable with `Wrapper::<bool> { i: true }` and removing relevant reassignments
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:160:5
|
2021-03-25 18:29:11 +00:00
|
|
|
|
|
|
|
|
LL | let mut a: Wrapper<bool> = Default::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:164:5
|
2021-03-25 18:29:11 +00:00
|
|
|
|
|
|
|
|
LL | a.i = 42;
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: consider initializing the variable with `WrapperMulti::<i32, i64> { i: 42, ..Default::default() }` and removing relevant reassignments
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:163:5
|
2021-03-25 18:29:11 +00:00
|
|
|
|
|
|
|
|
LL | let mut a: WrapperMulti<i32, i64> = Default::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2021-10-21 11:11:36 +00:00
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:235:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | f.name = name.len();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: consider initializing the variable with `issue6312::ImplDropAllCopy { name: name.len(), ..Default::default() }` and removing relevant reassignments
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:234:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let mut f = ImplDropAllCopy::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: field assignment outside of initializer for an instance created with Default::default()
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:251:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | f.name = name.len();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: consider initializing the variable with `issue6312::NoDropAllCopy { name: name.len(), ..Default::default() }` and removing relevant reassignments
|
2023-03-24 13:04:35 +00:00
|
|
|
--> $DIR/field_reassign_with_default.rs:250:13
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let mut f = NoDropAllCopy::default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to 11 previous errors
|
2020-11-05 13:29:48 +00:00
|
|
|
|