blob: b12c450c937fb9264311687cb4fb04b58e4818d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// run-pass
trait Foo {
fn a(&self) -> isize;
fn b(&self) -> isize {
self.a() + 2
}
}
impl Foo for isize {
fn a(&self) -> isize {
3
}
}
pub fn main() {
assert_eq!(3.b(), 5);
}
|