]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/arbitrary_self_types_struct.rs
Update ui tests
[rust.git] / src / test / ui / self / arbitrary_self_types_struct.rs
1 // run-pass
2 #![feature(arbitrary_self_types)]
3
4 use std::rc::Rc;
5
6 struct Foo {
7     x: i32,
8     y: i32,
9 }
10
11 impl Foo {
12     fn x(self: &Rc<Self>) -> i32 {
13         self.x
14     }
15
16     fn y(self: Rc<Self>) -> i32 {
17         self.y
18     }
19 }
20
21 fn main() {
22     let foo = Rc::new(Foo {x: 3, y: 4});
23     assert_eq!(3, foo.x());
24     assert_eq!(4, foo.y());
25 }