Skip to content

Commit

Permalink
Fixup clippy tests
Browse files Browse the repository at this point in the history
Don't depend on the fact that `!` falls back to `()` and so panic-ish things
can be used in `-> impl ImplementedForUnit` functions
  • Loading branch information
WaffleLapkin authored and compiler-errors committed Jun 13, 2024
1 parent b3acc15 commit fa864f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/tools/clippy/tests/ui/new_ret_no_self.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,7 @@ mod issue7344 {

impl<T> RetImplTraitSelf2<T> {
// should not trigger lint
fn new(t: T) -> impl Trait2<(), Self> {
unimplemented!()
}
fn new(t: T) -> impl Trait2<(), Self> {}
}

struct RetImplTraitNoSelf2<T>(T);
Expand All @@ -401,7 +399,6 @@ mod issue7344 {
// should trigger lint
fn new(t: T) -> impl Trait2<(), i32> {
//~^ ERROR: methods called `new` usually return `Self`
unimplemented!()
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/tools/clippy/tests/ui/new_ret_no_self.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,10 @@ LL | | }
| |_________^

error: methods called `new` usually return `Self`
--> tests/ui/new_ret_no_self.rs:402:9
--> tests/ui/new_ret_no_self.rs:400:9
|
LL | / fn new(t: T) -> impl Trait2<(), i32> {
LL | |
LL | | unimplemented!()
LL | | }
| |_________^

Expand Down

0 comments on commit fa864f8

Please sign in to comment.