rust/tests/ui/impl-not-adjacent-to-type.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
244 B
Rust
Raw Normal View History

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