rust/tests/ui/impl-not-adjacent-to-type.rs
Arthur Carcano 701dd5bc9d Allow unused fields in some tests
The dead_code lint was previously eroneously missing those.
Since this lint bug has been fixed, the unused fields warnings need
to be fixed.

Most of them are marked as `#[allow(dead_code)]`. Other warnings are
fixed by changing visibility of modules.
2024-03-12 10:59:41 +01:00

18 lines
244 B
Rust

//@ 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);
}