Skip to content

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

Closed

Description

@GuillaumeGomez

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.

Activity

  1. added
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    C-bugCategory: This is a bug.
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jan 6, 2020
  2. self-assigned this
    on Jan 6, 2020
  3. added a commit that references this issue on Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions