2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2012-12-03 02:29:22 +00:00
|
|
|
|
2015-03-22 20:13:15 +00:00
|
|
|
|
2012-12-03 02:29:22 +00:00
|
|
|
trait A<T> {
|
2013-06-12 18:05:03 +00:00
|
|
|
fn g<U>(&self, x: T, y: U) -> (T, U) { (x, y) }
|
2012-12-03 02:29:22 +00:00
|
|
|
}
|
|
|
|
|
2015-01-25 21:05:03 +00:00
|
|
|
impl A<i32> for i32 { }
|
|
|
|
impl<T> A<T> for u32 { }
|
2012-12-03 02:29:22 +00:00
|
|
|
|
|
|
|
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)
|
2012-12-03 02:29:22 +00:00
|
|
|
}
|
|
|
|
|
2013-02-17 22:36:43 +00:00
|
|
|
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));
|
2012-12-03 02:29:22 +00:00
|
|
|
}
|