Skip to content

Commit 5d0651e

Browse files
author
Henri Lunnikivi
committed
Freeze the lint output for field_reassign_with_default
1 parent c3c2e82 commit 5d0651e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)