rust/tests/ui/impl-not-adjacent-to-type.rs
2023-01-11 09:32:08 +00:00

17 lines
215 B
Rust

// run-pass
mod foo {
pub struct Point {
pub x: i32,
pub y: i32,
}
}
impl foo::Point {
fn x(&self) -> i32 { self.x }
}
fn main() {
assert_eq!((foo::Point { x: 1, y: 3}).x(), 1);
}