mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 21:53:23 +00:00
26 lines
467 B
Rust
26 lines
467 B
Rust
|
#![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() {}
|