rust/tests/ui/traits/anon-static-method.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
175 B
Rust
Raw Normal View History

// 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);
}