mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
17 lines
189 B
Rust
17 lines
189 B
Rust
// run-pass
|
|
|
|
|
|
trait A<T> {
|
|
fn g(&self, x: T) -> T { x }
|
|
}
|
|
|
|
impl A<isize> for isize { }
|
|
|
|
fn f<T, V: A<T>>(i: V, j: T) -> T {
|
|
i.g(j)
|
|
}
|
|
|
|
pub fn main () {
|
|
assert_eq!(f(0, 2), 2);
|
|
}
|