2019-07-26 16:54:25 -05:00
|
|
|
// run-pass
|
|
|
|
|
2018-09-14 05:20:28 -05:00
|
|
|
#![allow(dead_code)]
|
2012-12-17 16:57:37 -06:00
|
|
|
|
2012-10-08 14:39:30 -05:00
|
|
|
trait Foo {
|
2013-03-12 21:32:14 -05:00
|
|
|
fn f(&self) {
|
2014-01-09 04:06:55 -06:00
|
|
|
println!("Hello!");
|
2012-10-08 14:39:30 -05:00
|
|
|
self.g();
|
|
|
|
}
|
2013-03-12 21:32:14 -05:00
|
|
|
fn g(&self);
|
2012-10-08 14:39:30 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
struct A {
|
2015-03-25 19:06:52 -05:00
|
|
|
x: isize
|
2012-10-08 14:39:30 -05:00
|
|
|
}
|
|
|
|
|
2013-02-14 13:47:00 -06:00
|
|
|
impl Foo for A {
|
2013-03-12 21:32:14 -05:00
|
|
|
fn g(&self) {
|
2014-01-09 04:06:55 -06:00
|
|
|
println!("Goodbye!");
|
2012-10-08 14:39:30 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() {
|
2012-10-08 14:39:30 -05:00
|
|
|
let a = A { x: 1 };
|
|
|
|
a.f();
|
|
|
|
}
|