rust/src/test/ui/traits/trait-bounds-impl-comparison-duplicates.rs
2019-07-27 18:56:16 +03:00

17 lines
361 B
Rust

// run-pass
// Tests that type parameter bounds on an implementation need not match the
// trait exactly, as long as the implementation doesn't demand *more* bounds
// than the trait.
// pretty-expanded FIXME #23616
trait A {
fn foo<T: Eq + Ord>(&self);
}
impl A for isize {
fn foo<T: Ord>(&self) {} // Ord implies Eq, so this is ok.
}
fn main() {}