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