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