2 // Make sure rustc checks the type parameter bounds in implementations of traits,
14 fn test_error1_fn<T: Eq>(&self);
15 fn test_error2_fn<T: Eq + Ord>(&self);
16 fn test_error3_fn<T: Eq + Ord>(&self);
17 fn test3_fn<T: Eq + Ord>(&self);
18 fn test4_fn<T: Eq + Ord>(&self);
19 fn test_error5_fn<T: A>(&self);
20 fn test6_fn<T: A + Eq>(&self);
21 fn test_error7_fn<T: A>(&self);
22 fn test_error8_fn<T: B>(&self);
26 // invalid bound for T, was defined as Eq in trait
27 fn test_error1_fn<T: Ord>(&self) {}
30 // invalid bound for T, was defined as Eq + Ord in trait
31 fn test_error2_fn<T: Eq + B>(&self) {}
34 // invalid bound for T, was defined as Eq + Ord in trait
35 fn test_error3_fn<T: B + Eq>(&self) {}
38 // multiple bounds, same order as in trait
39 fn test3_fn<T: Ord + Eq>(&self) {}
41 // multiple bounds, different order as in trait
42 fn test4_fn<T: Eq + Ord>(&self) {}
44 // parameters in impls must be equal or more general than in the defining trait
45 fn test_error5_fn<T: B>(&self) {}
48 // bound `std::cmp::Eq` not enforced by this implementation, but this is OK
49 fn test6_fn<T: A>(&self) {}
51 fn test_error7_fn<T: A + Eq>(&self) {}
54 fn test_error8_fn<T: C>(&self) {}
59 fn get(&self) -> T { loop { } }
63 fn method<G:Getter<isize>>(&self);
66 impl Trait for usize {
67 fn method<G: Getter<usize>>(&self) {}