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 268b556393
commit a22f8aa17a
2 changed files with 2 additions and 6 deletions

View File

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

View File

@ -96,11 +96,10 @@ LL | | }
| |_________^ | |_________^
error: methods called `new` usually return `Self` 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 | / fn new(t: T) -> impl Trait2<(), i32> {
LL | | LL | |
LL | | unimplemented!()
LL | | } LL | | }
| |_________^ | |_________^