blob: 905ad83b659d4fafb3efd2b05f3ba10be1d2c97d [file] [log] [blame]
// run-pass
use std::rc::Rc;
struct Foo {
x: i32,
y: i32,
}
impl Foo {
fn x(self: &Rc<Self>) -> i32 {
self.x
}
fn y(self: Rc<Self>) -> i32 {
self.y
}
}
fn main() {
let foo = Rc::new(Foo {x: 3, y: 4});
assert_eq!(3, foo.x());
assert_eq!(4, foo.y());
}