1 // run-pass 2 3 mod foo { 4 pub struct Point { 5 pub x: i32, 6 pub y: i32, 7 } 8 } 9 10 impl foo::Point { x(&self) -> i3211 fn x(&self) -> i32 { self.x } 12 } 13 main()14 fn main() { 15 assert_eq!((foo::Point { x: 1, y: 3}).x(), 1); 16 } 17