mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
Merge commit 'd5e2a7aca55ed49fc943b7a07a8eba05ab5a0079' into clippyup
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
error: unnecessary struct building
|
||||
--> $DIR/unnecessary_struct_initialization.rs:34:9
|
||||
|
|
||||
LL | Self { ..*self }
|
||||
| ^^^^^^^^^^^^^^^^ help: replace with: `*self`
|
||||
|
|
||||
= note: `-D clippy::unnecessary-struct-initialization` implied by `-D warnings`
|
||||
|
||||
error: unnecessary struct building
|
||||
--> $DIR/unnecessary_struct_initialization.rs:41:17
|
||||
|
|
||||
LL | let mut b = S { ..a };
|
||||
| ^^^^^^^^^ help: replace with: `a`
|
||||
|
||||
error: unnecessary struct building
|
||||
--> $DIR/unnecessary_struct_initialization.rs:44:18
|
||||
|
|
||||
LL | let c = &mut S { ..b };
|
||||
| ^^^^^^^^^ help: replace with: `b`
|
||||
|
||||
error: unnecessary struct building
|
||||
--> $DIR/unnecessary_struct_initialization.rs:52:14
|
||||
|
|
||||
LL | let g = &S { ..f };
|
||||
| ^^^^^^^^^ help: replace with: `f`
|
||||
|
||||
error: unnecessary struct building
|
||||
--> $DIR/unnecessary_struct_initialization.rs:55:18
|
||||
|
|
||||
LL | let h = &mut S {
|
||||
| __________________^
|
||||
LL | | ..*Box::new(S { f: String::from("foo") })
|
||||
LL | | };
|
||||
| |_____^ help: replace with: `*Box::new(S { f: String::from("foo") })`
|
||||
|
||||
error: unnecessary struct building
|
||||
--> $DIR/unnecessary_struct_initialization.rs:74:18
|
||||
|
|
||||
LL | let p = &mut T {
|
||||
| __________________^
|
||||
LL | | ..*Box::new(T { f: 5 })
|
||||
LL | | };
|
||||
| |_____^ help: replace with: `*Box::new(T { f: 5 })`
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
Reference in New Issue
Block a user