Skip to content

Commit 9be3945

Browse files
committed
fix existing clippy tests
1 parent 528ada9 commit 9be3945

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+109
-107
lines changed

clippy_lints/src/use_self.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ declare_clippy_lint! {
3434
///
3535
/// ### Example
3636
/// ```rust
37-
/// struct Foo {}
37+
/// struct Foo;
3838
/// impl Foo {
3939
/// fn new() -> Foo {
4040
/// Foo {}
@@ -43,7 +43,7 @@ declare_clippy_lint! {
4343
/// ```
4444
/// could be
4545
/// ```rust
46-
/// struct Foo {}
46+
/// struct Foo;
4747
/// impl Foo {
4848
/// fn new() -> Self {
4949
/// Self {}

tests/ui-toml/struct_excessive_bools/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ struct S {
44
a: bool,
55
}
66

7-
struct Foo {}
7+
struct Foo;
88

99
fn main() {}

tests/ui/case_sensitive_file_extension_comparisons.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use std::string::String;
44

5-
struct TestStruct {}
5+
struct TestStruct;
66

77
impl TestStruct {
88
fn ends_with(self, arg: &str) {}

tests/ui/crashes/ice-2774.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub struct Bar {
88
}
99

1010
#[derive(Eq, PartialEq, Debug, Hash)]
11-
pub struct Foo {}
11+
pub struct Foo;
1212

1313
#[allow(clippy::implicit_hasher)]
1414
// This should not cause a "cannot relate bound region" ICE.

tests/ui/crashes/ice-6179.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![warn(clippy::use_self)]
55
#![allow(dead_code)]
66

7-
struct Foo {}
7+
struct Foo;
88

99
impl Foo {
1010
fn new() -> Self {

tests/ui/crashes/ice-6792.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trait Trait {
77
fn broken() -> Self::Ty;
88
}
99

10-
struct Foo {}
10+
struct Foo;
1111

1212
impl Trait for Foo {
1313
type Ty = Foo;

tests/ui/crashes/needless_lifetimes_impl_trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
trait Foo {}
55

6-
struct Bar {}
6+
struct Bar;
77

88
struct Baz<'a> {
99
bar: &'a Bar,

tests/ui/crashes/regressions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ pub fn foo(bar: *const u8) {
66

77
// Regression test for https://github.com/rust-lang/rust-clippy/issues/4917
88
/// <foo
9-
struct A {}
9+
struct A;
1010

1111
fn main() {}

tests/ui/default_numeric_fallback_f64.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ mod enum_ctor {
134134
}
135135

136136
mod method_calls {
137-
struct StructForMethodCallTest {}
137+
struct StructForMethodCallTest;
138138

139139
impl StructForMethodCallTest {
140140
fn concrete_arg(&self, f: f64) {}

tests/ui/default_numeric_fallback_f64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ mod enum_ctor {
134134
}
135135

136136
mod method_calls {
137-
struct StructForMethodCallTest {}
137+
struct StructForMethodCallTest;
138138

139139
impl StructForMethodCallTest {
140140
fn concrete_arg(&self, f: f64) {}

0 commit comments

Comments
 (0)