Skip to content

Commit a22f8aa

Browse files
committed
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
1 parent 268b556 commit a22f8aa

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/tools/clippy/tests/ui/new_ret_no_self.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,7 @@ mod issue7344 {
390390

391391
impl<T> RetImplTraitSelf2<T> {
392392
// should not trigger lint
393-
fn new(t: T) -> impl Trait2<(), Self> {
394-
unimplemented!()
395-
}
393+
fn new(t: T) -> impl Trait2<(), Self> {}
396394
}
397395

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

src/tools/clippy/tests/ui/new_ret_no_self.stderr

+1-2
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,10 @@ LL | | }
9696
| |_________^
9797

9898
error: methods called `new` usually return `Self`
99-
--> tests/ui/new_ret_no_self.rs:402:9
99+
--> tests/ui/new_ret_no_self.rs:400:9
100100
|
101101
LL | / fn new(t: T) -> impl Trait2<(), i32> {
102102
LL | |
103-
LL | | unimplemented!()
104103
LL | | }
105104
| |_________^
106105

0 commit comments

Comments
 (0)