Skip to content

#[deriving] implementations need #[allow(unused_qualifications)] #19102

Closed
@chris-morgan

Description

@chris-morgan

Example:

#![warn(unused_qualifications)]

use self::A::B;

#[deriving(PartialEq)]
pub enum A {
    B,
}

fn main() {
}

Output:

a.rs:7:5: 7:6 warning: unnecessary qualification
a.rs:7     B,
           ^
note: in expansion of #[deriving]
a.rs:5:1: 5:23 note: expansion site
a.rs:1:9: 1:30 note: lint level defined here
a.rs:1 #![warn(unused_qualifications)]
               ^~~~~~~~~~~~~~~~~~~~~
a.rs:7:5: 7:6 warning: unnecessary qualification
a.rs:7     B,
           ^
note: in expansion of #[deriving]
a.rs:5:1: 5:23 note: expansion site
a.rs:1:9: 1:30 note: lint level defined here
a.rs:1 #![warn(unused_qualifications)]
               ^~~~~~~~~~~~~~~~~~~~~
a.rs:7:5: 7:6 warning: unnecessary qualification
a.rs:7     B,
           ^
note: in expansion of #[deriving]
a.rs:5:1: 5:23 note: expansion site
a.rs:1:9: 1:30 note: lint level defined here
a.rs:1 #![warn(unused_qualifications)]
               ^~~~~~~~~~~~~~~~~~~~~
a.rs:7:5: 7:6 warning: unnecessary qualification
a.rs:7     B,
           ^
note: in expansion of #[deriving]
a.rs:5:1: 5:23 note: expansion site
a.rs:1:9: 1:30 note: lint level defined here
a.rs:1 #![warn(unused_qualifications)]
               ^~~~~~~~~~~~~~~~~~~~~

This is something that wasn’t an issue before, but with the scoping of enum variants can very easily become a problem now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-syntaxextArea: Syntax extensionsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions