3 // Issue Name: pub method preceded by attribute can't be parsed
4 // Abstract: Visibility parsing failed when compiler parsing
14 #[derive(Copy, Clone)]
17 Rectangle(Point, Point)
21 pub fn area(&self, sh: Shape) -> f64 {
23 Shape::Circle(_, size) => f64::consts::PI * size * size,
24 Shape::Rectangle(Point {x, y}, Point {x: x2, y: y2}) => (x2 - x) * (y2 - y)
30 let s = Shape::Circle(Point { x: 1.0, y: 2.0 }, 3.0);
31 println!("{}", s.area(s));