Open
Description
Given the following code
#![warn(warnings, unused)]
fn main() {
let x = 13;
}
running rustc -A unused test.rs
shows a warning that x
is unused as expected (since the module scope takes precedence over the command-line arguments). However, rustc -A warnings
prints nothing.
This is caused by the following special handling:
rust/src/librustc_session/session.rs
Lines 1178 to 1189 in 01ffbcb
The FIXME already describes the problem, but I haven't found an open issue for this.
The special case was introduced by this commit as part of #21248. Looks like it is a hack needed to silence some otherwise unsilenceable warnings -- but I am not sure if the hack is still needed, or if there isn't a better way to do this.