-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[
implied_bounds_in_impls
]: move to nursery and fix ICEs
- Loading branch information
Showing
7 changed files
with
203 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#![warn(clippy::implied_bounds_in_impls)] | ||
|
||
use std::fmt::Debug; | ||
use std::ops::*; | ||
|
||
fn gen() -> impl PartialOrd + Debug {} | ||
|
||
struct Bar {} | ||
trait Foo<T = Self> {} | ||
trait FooNested<T = Option<Self>> {} | ||
impl Foo for Bar {} | ||
impl FooNested for Bar {} | ||
|
||
fn foo() -> impl Foo + FooNested { | ||
Bar {} | ||
} | ||
|
||
fn test_impl_ops() -> impl Add + Sub + Mul + Div { | ||
1 | ||
} | ||
fn test_impl_assign_ops() -> impl AddAssign + SubAssign + MulAssign + DivAssign { | ||
1 | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#![warn(clippy::implied_bounds_in_impls)] | ||
|
||
use std::fmt::Debug; | ||
use std::ops::*; | ||
|
||
fn gen() -> impl PartialOrd + PartialEq + Debug {} | ||
|
||
struct Bar {} | ||
trait Foo<T = Self> {} | ||
trait FooNested<T = Option<Self>> {} | ||
impl Foo for Bar {} | ||
impl FooNested for Bar {} | ||
|
||
fn foo() -> impl Foo + FooNested { | ||
Bar {} | ||
} | ||
|
||
fn test_impl_ops() -> impl Add + Sub + Mul + Div { | ||
1 | ||
} | ||
fn test_impl_assign_ops() -> impl AddAssign + SubAssign + MulAssign + DivAssign { | ||
1 | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error: this bound is already specified as the supertrait of `PartialOrd` | ||
--> $DIR/ice-11422.rs:6:31 | ||
| | ||
LL | fn gen() -> impl PartialOrd + PartialEq + Debug {} | ||
| ^^^^^^^^^ | ||
| | ||
= note: `-D clippy::implied-bounds-in-impls` implied by `-D warnings` | ||
help: try removing this bound | ||
| | ||
LL - fn gen() -> impl PartialOrd + PartialEq + Debug {} | ||
LL + fn gen() -> impl PartialOrd + Debug {} | ||
| | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters