Skip to content

Nightly version ignores allow(unused) #43910

Closed
@jo-so

Description

@jo-so

The current nightly version (rustc 1.21.0-nightly (df511d5 2017-08-14)) warns about an unused variable, even if it's flagged with allow(). The stable version doesn't do so.

fn main() {
    #[allow(unused_variables)] let x = 12;
    let y = 11;
}
warning: unused variable: `x`
 --> src/main.rs:2:36
  |
2 |     #[allow(unused_variables)] let x = 12;
  |                                    ^
  |
  = note: #[warn(unused_variables)] on by default

https://play.rust-lang.org/?gist=9b81da266dd1f4383760de35d94f7ff6&version=nightly

Metadata

Metadata

Assignees

Labels

A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions