Fixup clippy tests

Don't depend on the fact that `!` falls back to `()` and so panic-ish things
can be used in `-> impl ImplementedForUnit` functions
This commit is contained in:
Waffle Lapkin 2024-05-23 18:02:13 +02:00
parent 35f54fd439
commit c3d463333f
2 changed files with 2 additions and 6 deletions

View File

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

View File

@ -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 | | }
| |_________^