about summary refs log tree commit diff
path: root/tests/ui/traits/bound/impl-comparison-duplicates.rs
blob: 14553ed27b7a49e02ab353f2ab973983ff9b3611 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ check-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.


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() {}