We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac1800f commit 3de7e14Copy full SHA for 3de7e14
tests/ui/field_reassign_with_default.stderr
@@ -0,0 +1,15 @@
1
+error: field assignment outside of initializer for an instance created with Default::default()
2
+ --> $DIR/field_reassign_with_default.rs:17: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 immutably with `A { i: 42, ..Default::default() }`
9
+ --> $DIR/field_reassign_with_default.rs:16:5
10
11
+LL | let mut a: A = Default::default();
12
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13
+
14
+error: aborting due to previous error
15
0 commit comments