mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
16 lines
175 B
Rust
16 lines
175 B
Rust
// run-pass
|
|
struct Foo {
|
|
x: isize
|
|
}
|
|
|
|
impl Foo {
|
|
pub fn new() -> Foo {
|
|
Foo { x: 3 }
|
|
}
|
|
}
|
|
|
|
pub fn main() {
|
|
let x = Foo::new();
|
|
println!("{}", x.x);
|
|
}
|