summaryrefslogtreecommitdiffstats
path: root/src/test/ui/traits/inheritance/cross-trait-call-xc.rs
blob: 99fbb5c6148dcba1920ede95f10d5d1f224dfb43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// run-pass
// aux-build:xc_call.rs


extern crate xc_call as aux;

use aux::Foo;

trait Bar : Foo {
    fn g(&self) -> isize;
}

impl Bar for aux::A {
    fn g(&self) -> isize { self.f() }
}

pub fn main() {
    let a = &aux::A { x: 3 };
    assert_eq!(a.g(), 10);
}