rust/src/test/run-pass/trait-default-method-bound.rs

14 lines
126 B
Rust
Raw Normal View History

trait A {
fn g() -> int { 10 }
}
impl int: A { }
fn f<T: A>(i: T) {
assert i.g() == 10;
}
fn main () {
f(0);
}