rust/tests/ui/traits/default-method/bound-subst.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
290 B
Rust
Raw Normal View History

// run-pass
trait A<T> {
fn g<U>(&self, x: T, y: U) -> (T, U) { (x, y) }
}
2015-01-25 21:05:03 +00:00
impl A<i32> for i32 { }
impl<T> A<T> for u32 { }
fn f<T, U, V: A<T>>(i: V, j: T, k: U) -> (T, U) {
2013-02-15 10:44:18 +00:00
i.g(j, k)
}
pub fn main () {
2015-01-25 21:05:03 +00:00
assert_eq!(f(0, 1, 2), (1, 2));
assert_eq!(f(0, 1, 2), (1, 2));
}