1
Fork 0
rust/tests/ui/traits/inheritance/cross-trait-call-xc.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
270 B
Rust
Raw Normal View History

//@ run-pass
2021-02-08 23:15:45 +01:00
//@ aux-build:xc_call.rs
2021-02-08 23:15:45 +01:00
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);
}