fixed span and corrected test output
This commit is contained in:
parent
032bc11fd4
commit
220a9db642
2 changed files with 13 additions and 13 deletions
|
@ -54,7 +54,7 @@ impl LateLintPass<'_> for DefaultConstructedUnitStruct {
|
||||||
span_lint_and_sugg(
|
span_lint_and_sugg(
|
||||||
cx,
|
cx,
|
||||||
DEFAULT_CONSTRUCTED_UNIT_STRUCT,
|
DEFAULT_CONSTRUCTED_UNIT_STRUCT,
|
||||||
qpath.last_segment_span(),
|
expr.span.with_lo(qpath.qself_span().hi()),
|
||||||
"use of `default` to create a unit struct",
|
"use of `default` to create a unit struct",
|
||||||
"remove this call to `default`",
|
"remove this call to `default`",
|
||||||
String::new(),
|
String::new(),
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
error: Use of `default` to create a unit struct.
|
error: use of `default` to create a unit struct
|
||||||
--> $DIR/default_constructed_unit_struct.rs:39:33
|
--> $DIR/default_constructed_unit_struct.rs:39:31
|
||||||
|
|
|
|
||||||
LL | inner: PhantomData::default(),
|
LL | inner: PhantomData::default(),
|
||||||
| ^^^^^^^ help: remove this call to `default`
|
| ^^^^^^^^^^^ help: remove this call to `default`
|
||||||
|
|
|
|
||||||
= note: `-D clippy::default-constructed-unit-struct` implied by `-D warnings`
|
= note: `-D clippy::default-constructed-unit-struct` implied by `-D warnings`
|
||||||
|
|
||||||
error: Use of `default` to create a unit struct.
|
error: use of `default` to create a unit struct
|
||||||
--> $DIR/default_constructed_unit_struct.rs:62:35
|
--> $DIR/default_constructed_unit_struct.rs:62:33
|
||||||
|
|
|
|
||||||
LL | let _ = PhantomData::<usize>::default();
|
LL | let _ = PhantomData::<usize>::default();
|
||||||
| ^^^^^^^ help: remove this call to `default`
|
| ^^^^^^^^^^^ help: remove this call to `default`
|
||||||
|
|
||||||
error: Use of `default` to create a unit struct.
|
error: use of `default` to create a unit struct
|
||||||
--> $DIR/default_constructed_unit_struct.rs:63:44
|
--> $DIR/default_constructed_unit_struct.rs:63:42
|
||||||
|
|
|
|
||||||
LL | let _: PhantomData<i32> = PhantomData::default();
|
LL | let _: PhantomData<i32> = PhantomData::default();
|
||||||
| ^^^^^^^ help: remove this call to `default`
|
| ^^^^^^^^^^^ help: remove this call to `default`
|
||||||
|
|
||||||
error: Use of `default` to create a unit struct.
|
error: use of `default` to create a unit struct
|
||||||
--> $DIR/default_constructed_unit_struct.rs:64:25
|
--> $DIR/default_constructed_unit_struct.rs:64:23
|
||||||
|
|
|
|
||||||
LL | let _ = UnitStruct::default();
|
LL | let _ = UnitStruct::default();
|
||||||
| ^^^^^^^ help: remove this call to `default`
|
| ^^^^^^^^^^^ help: remove this call to `default`
|
||||||
|
|
||||||
error: aborting due to 4 previous errors
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue