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
commita22f8aa17abcd2f0dfb83aa8ee41509f922be6ab (patch)
treea631c05bc5febfee59378271763f55dd808db574
parent268b55639344f783c722cc6e605a3d04cddaab2d (diff)
downloadrust-a22f8aa17abcd2f0dfb83aa8ee41509f922be6ab.tar.gz
rust-a22f8aa17abcd2f0dfb83aa8ee41509f922be6ab.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--src/tools/clippy/tests/ui/new_ret_no_self.rs5
-rw-r--r--src/tools/clippy/tests/ui/new_ret_no_self.stderr3
2 files changed, 2 insertions, 6 deletions
diff --git a/src/tools/clippy/tests/ui/new_ret_no_self.rs b/src/tools/clippy/tests/ui/new_ret_no_self.rs
index b944f531ef6..175b14d815a 100644
--- a/src/tools/clippy/tests/ui/new_ret_no_self.rs
+++ b/src/tools/clippy/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/src/tools/clippy/tests/ui/new_ret_no_self.stderr b/src/tools/clippy/tests/ui/new_ret_no_self.stderr
index d440a9f45fc..3597ad65838 100644
--- a/src/tools/clippy/tests/ui/new_ret_no_self.stderr
+++ b/src/tools/clippy/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 | |         }
    | |_________^