Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nightly version ignores allow(unused) #43910

Closed
jo-so opened this issue Aug 16, 2017 · 3 comments
Closed

Nightly version ignores allow(unused) #43910

jo-so opened this issue Aug 16, 2017 · 3 comments
Assignees
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jo-so
Copy link

jo-so commented Aug 16, 2017

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

@Mark-Simulacrum
Copy link
Member

cc @alexcrichton -- would this have been fixed by #43841? Not sure if that's present in this nightly.

@Mark-Simulacrum Mark-Simulacrum added A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 17, 2017
@alexcrichton
Copy link
Member

Hm no this was not fixed by #43841, I don't know offhand what might cause this, would have to investigate.

@nikomatsakis
Copy link
Contributor

triage: P-high

@alexcrichton, took the liberty of assigning you since it seems likely related to the changes to lint handling.

@rust-highfive rust-highfive added the P-high High priority label Aug 17, 2017
alexcrichton added a commit to alexcrichton/rust that referenced this issue Aug 18, 2017
When walking parents for lints we want to be sure to hit `let` statements which
can have attributes, so hook up these statements in the HIR map.

Closes rust-lang#43910
bors added a commit that referenced this issue Aug 21, 2017
rustc: Add `Local` to the HIR map of parents

When walking parents for lints we want to be sure to hit `let` statements which
can have attributes, so hook up these statements in the HIR map.

Closes #43910
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants