-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wherein the status of empty and reason-only lint attributes is clarified
We avoid an ICE by checking for an empty meta-item list before we index into the meta-items, and leave commentary about where we'd like to issue unused-attributes lints in the future. Note that empty lint attributes are already accepted by the stable compiler; generalizing this to weird reason-only lint attributes seems like the conservative/consilient generalization.
- Loading branch information
1 parent
f90de11
commit f66ea66
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#![feature(lint_reasons)] | ||
|
||
// run-pass | ||
|
||
// Empty (and reason-only) lint attributes are legal—although we may want to | ||
// lint them in the future (Issue #55112). | ||
|
||
#![allow()] | ||
#![warn(reason = "observationalism")] | ||
|
||
#[forbid()] | ||
fn devoir() {} | ||
|
||
#[deny(reason = "ultion")] | ||
fn waldgrave() {} | ||
|
||
fn main() {} |