rust/tests/ui/traits/default-method/bound-subst3.rs
2023-01-11 09:32:08 +00:00

18 lines
261 B
Rust

// run-pass
trait A {
fn g<T>(&self, x: T, y: T) -> (T, T) { (x, y) }
}
impl A for isize { }
fn f<T, V: A>(i: V, j: T, k: T) -> (T, T) {
i.g(j, k)
}
pub fn main () {
assert_eq!(f(0, 1, 2), (1, 2));
assert_eq!(f(0, 1u8, 2u8), (1u8, 2u8));
}