701dd5bc9d
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.
18 lines
244 B
Rust
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);
|
|
}
|