-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Freeze the lint output for field_reassign_with_default
- Loading branch information
Henri Lunnikivi
committed
Nov 1, 2019
1 parent
ac1800f
commit 3de7e14
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error: field assignment outside of initializer for an instance created with Default::default() | ||
--> $DIR/field_reassign_with_default.rs:17:5 | ||
| | ||
LL | a.i = 42; | ||
| ^^^^^^^^^ | ||
| | ||
= note: `-D clippy::field-reassign-with-default` implied by `-D warnings` | ||
note: consider initializing the variable immutably with `A { i: 42, ..Default::default() }` | ||
--> $DIR/field_reassign_with_default.rs:16:5 | ||
| | ||
LL | let mut a: A = Default::default(); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|