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