Using `default` to construct a unit struct increases code complexity and adds a function call. This can be avoided by simply removing the call to `default` and simply construct by name.
28 lines
1.1 KiB
Text
28 lines
1.1 KiB
Text
error: Use of `default` to create a unit struct.
|
|
--> $DIR/default_constructed_unit_struct.rs:39:33
|
|
|
|
|
LL | inner: PhantomData::default(),
|
|
| ^^^^^^^ help: remove this call to `default`
|
|
|
|
|
= note: `-D clippy::default-constructed-unit-struct` implied by `-D warnings`
|
|
|
|
error: Use of `default` to create a unit struct.
|
|
--> $DIR/default_constructed_unit_struct.rs:62:35
|
|
|
|
|
LL | let _ = PhantomData::<usize>::default();
|
|
| ^^^^^^^ help: remove this call to `default`
|
|
|
|
error: Use of `default` to create a unit struct.
|
|
--> $DIR/default_constructed_unit_struct.rs:63:44
|
|
|
|
|
LL | let _: PhantomData<i32> = PhantomData::default();
|
|
| ^^^^^^^ help: remove this call to `default`
|
|
|
|
error: Use of `default` to create a unit struct.
|
|
--> $DIR/default_constructed_unit_struct.rs:64:25
|
|
|
|
|
LL | let _ = UnitStruct::default();
|
|
| ^^^^^^^ help: remove this call to `default`
|
|
|
|
error: aborting due to 4 previous errors
|
|
|