2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2012-08-14 18:17:18 -07:00
|
|
|
struct Foo {
|
2015-03-25 17:06:52 -07:00
|
|
|
x: isize,
|
2012-08-14 18:17:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
trait Stuff {
|
2013-03-12 22:36:24 -07:00
|
|
|
fn printme(&self);
|
2012-08-14 18:17:18 -07:00
|
|
|
}
|
|
|
|
|
2013-03-12 22:36:24 -07:00
|
|
|
impl Stuff for Foo {
|
|
|
|
fn printme(&self) {
|
2013-09-24 22:16:43 -07:00
|
|
|
println!("{}", self.x);
|
2012-08-14 18:17:18 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2012-08-14 18:17:18 -07:00
|
|
|
let x = Foo { x: 3 };
|
|
|
|
x.printme();
|
|
|
|
}
|