Skip to content

#[forbid(unused_qualifications)] is incompatible with all builtin derives #71898

Closed
@jonas-schievink

Description

@jonas-schievink
#![forbid(unused_qualifications)]

#[derive(Clone)]
pub struct S;
error[E0453]: allow(unused_qualifications) overruled by outer forbid(unused_qualifications)
 --> src/main.rs:3:10
  |
1 | #![forbid(unused_qualifications)]
  |           --------------------- `forbid` level set here
2 | 
3 | #[derive(Clone)]
  |          ^^^^^ overruled by previous forbid

All built-in custom derives put #[allow(unused_qualifications)] on the generated impl, but the forbid level can not be overridden by that.

Custom derives are not able to trigger the deprecated lint, despite not attaching #[allow(deprecated)], so maybe the same mechanism should be used for unused_qualifications?

Metadata

Metadata

Assignees

Labels

A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-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