rust/tests/ui/autoref-autoderef/auto-ref.rs
2023-01-11 09:32:08 +00:00

20 lines
229 B
Rust

// run-pass
struct Foo {
x: isize,
}
trait Stuff {
fn printme(&self);
}
impl Stuff for Foo {
fn printme(&self) {
println!("{}", self.x);
}
}
pub fn main() {
let x = Foo { x: 3 };
x.printme();
}