mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 03:25:55 +00:00
18 lines
262 B
Rust
18 lines
262 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));
|
|
}
|