mirror of
https://github.com/rust-lang/rust
synced 2024-09-06 01:11:17 +00:00
![Arthur Carcano](/assets/img/avatar_default.png)
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 };
|
|
}
|