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.
27 lines
337 B
Rust
27 lines
337 B
Rust
//@ run-pass
|
|
|
|
#![allow(unused_variables)]
|
|
|
|
macro_rules! duplicate {
|
|
($i: item) => {
|
|
mod m1 {
|
|
$i
|
|
}
|
|
mod m2 {
|
|
$i
|
|
}
|
|
}
|
|
}
|
|
|
|
duplicate! {
|
|
pub union U {
|
|
#[allow(dead_code)]
|
|
pub a: u8
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let u1 = m1::U { a: 0 };
|
|
let u2 = m2::U { a: 0 };
|
|
}
|