2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2012-10-15 18:04:15 -07:00
|
|
|
struct Foo {
|
2015-03-25 17:06:52 -07:00
|
|
|
x: isize
|
2012-10-15 18:04:15 -07:00
|
|
|
}
|
|
|
|
|
|
2013-05-31 15:17:22 -07:00
|
|
|
impl Foo {
|
|
|
|
|
pub fn new() -> Foo {
|
2012-10-15 18:04:15 -07:00
|
|
|
Foo { x: 3 }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2012-10-15 18:04:15 -07:00
|
|
|
let x = Foo::new();
|
2014-01-09 21:06:55 +11:00
|
|
|
println!("{}", x.x);
|
2012-10-15 18:04:15 -07:00
|
|
|
}
|