2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2021-02-08 16:15:45 -06:00
|
|
|
// aux-build:xc_call.rs
|
2012-11-28 14:34:30 -06:00
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
|
2021-02-08 16:15:45 -06:00
|
|
|
extern crate xc_call as aux;
|
2012-11-28 14:34:30 -06:00
|
|
|
|
2013-03-05 16:49:03 -06:00
|
|
|
use aux::Foo;
|
|
|
|
|
|
|
|
trait Bar : Foo {
|
2015-03-25 19:06:52 -05:00
|
|
|
fn g(&self) -> isize;
|
2012-11-28 14:34:30 -06:00
|
|
|
}
|
|
|
|
|
2013-02-14 13:47:00 -06:00
|
|
|
impl Bar for aux::A {
|
2015-03-25 19:06:52 -05:00
|
|
|
fn g(&self) -> isize { self.f() }
|
2012-11-28 14:34:30 -06:00
|
|
|
}
|
|
|
|
|
2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() {
|
2012-11-28 14:34:30 -06:00
|
|
|
let a = &aux::A { x: 3 };
|
2013-05-18 21:02:45 -05:00
|
|
|
assert_eq!(a.g(), 10);
|
2012-11-28 14:34:30 -06:00
|
|
|
}
|