about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWaffle Lapkin <waffle.lapkin@gmail.com>2024-05-23 18:02:13 +0200
committerWaffle Lapkin <waffle.lapkin@gmail.com>2024-06-13 12:24:31 +0200
commitc3d463333f87821938c3fa6e71af8e455b9bf6c4 (patch)
treef74cb7dcf122889f92067f51168e16f4cd4df65d
parent35f54fd439432f56c749fbb34f1326e34ed1fc42 (diff)
downloadrust-c3d463333f87821938c3fa6e71af8e455b9bf6c4.tar.gz
rust-c3d463333f87821938c3fa6e71af8e455b9bf6c4.zip
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
-rw-r--r--tests/ui/new_ret_no_self.rs5
-rw-r--r--tests/ui/new_ret_no_self.stderr3
2 files changed, 2 insertions, 6 deletions
diff --git a/tests/ui/new_ret_no_self.rs b/tests/ui/new_ret_no_self.rs
index b944f531ef6..175b14d815a 100644
--- a/tests/ui/new_ret_no_self.rs
+++ b/tests/ui/new_ret_no_self.rs
@@ -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!()
         }
     }
 
diff --git a/tests/ui/new_ret_no_self.stderr b/tests/ui/new_ret_no_self.stderr
index d440a9f45fc..3597ad65838 100644
--- a/tests/ui/new_ret_no_self.stderr
+++ b/tests/ui/new_ret_no_self.stderr
@@ -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 | |         }
    | |_________^