Skip to content

#[deny(warnings) isn't working on E0170 #67933

New issue

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

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

Already on GitHub? # to your account

Closed
GuillaumeGomez opened this issue Jan 6, 2020 · 0 comments · Fixed by #67770
Closed

#[deny(warnings) isn't working on E0170 #67933

GuillaumeGomez opened this issue Jan 6, 2020 · 0 comments · Fixed by #67770
Assignees
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@GuillaumeGomez
Copy link
Member

This code compiles without errors:

#![allow(unused_variables)]
#![allow(non_snake_case)]
#![allow(unreachable_patterns)]
#![allow(dead_code)]
#![deny(warnings)]

enum Foo {
    Bar,
    Baz,
}

fn fn1(e: Foo) {
    match e {
        Bar => {},
        Baz => {},
    }
}

fn main() {}

With the following output:

Compiling playground v0.0.1 (/playground)
warning[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo`
  --> src/main.rs:14:9
   |
14 |         Bar => {},
   |         ^^^ help: to match on the variant, qualify the path: `Foo::Bar`

warning[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo`
  --> src/main.rs:16:9
   |
16 |         Baz => {},
   |         ^^^ help: to match on the variant, qualify the path: `Foo::Baz`

    Finished dev [unoptimized + debuginfo] target(s) in 0.37s
     Running `target/debug/playground`

However, the #[deny(warnings)] should make it fail.

@Centril Centril added A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 6, 2020
@Centril Centril self-assigned this Jan 6, 2020
@Centril Centril added the P-medium Medium priority label Jan 6, 2020
@bors bors closed this as completed in ed6468d Jan 8, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants