rust/tests/ui/traits/anon-static-method.rs
2024-02-16 20:02:50 +00:00

16 lines
176 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);
}