mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-17 05:25:37 +03:00
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:
@@ -390,9 +390,7 @@ impl<T, U> Trait2<T, U> for () {}
|
||||
|
||||
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 @@ impl<T> RetImplTraitNoSelf2<T> {
|
||||
// should trigger lint
|
||||
fn new(t: T) -> impl Trait2<(), i32> {
|
||||
//~^ ERROR: methods called `new` usually return `Self`
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 | | }
|
||||
| |_________^
|
||||
|
||||
|
||||
Reference in New Issue
Block a user