rust/tests/ui/traits/default-method/bound.rs
2023-01-11 09:32:08 +00:00

17 lines
158 B
Rust

// run-pass
trait A {
fn g(&self) -> isize { 10 }
}
impl A for isize { }
fn f<T:A>(i: T) {
assert_eq!(i.g(), 10);
}
pub fn main () {
f(0);
}