// Test impl block parsing struct Point { x: f64, y: f64 } impl Point { fn new(x: f64, y: f64) -> Point { Point { x: x, y: y } } fn distance(self, other: Point) -> f64 { let dx = self.x - other.x let dy = self.y - other.y (dx * dx + dy * dy) } } // Generic impl block struct Vec { data: [T] } impl Vec { fn new() -> Vec { Vec { data: [] } } fn push(self, item: T) -> Vec { self } } // Impl with where clause impl Vec where T: Clone { fn clone_all(self) -> Vec { self } }