Skip to content

Commit

Permalink
Prevent forbid from being ignored if overriden at the same level.
Browse files Browse the repository at this point in the history
That is, this changes `#[forbid(foo)] #[allow(foo)]` from allowing foo to
forbidding foo.
  • Loading branch information
pnkfelix authored and Mark-Simulacrum committed Oct 4, 2020
1 parent 840f7da commit 5747c15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
1 change: 0 additions & 1 deletion tests/ui/attrs.rs
Expand Up @@ -3,7 +3,6 @@
// Test that the whole restriction group is not enabled
#![warn(clippy::restriction)]
#![deny(clippy::restriction)]
#![forbid(clippy::restriction)]
#![allow(clippy::missing_docs_in_private_items, clippy::panic, clippy::unreachable)]

#[inline(always)]
Expand Down
16 changes: 4 additions & 12 deletions tests/ui/attrs.stderr
@@ -1,21 +1,21 @@
error: you have declared `#[inline(always)]` on `test_attr_lint`. This is usually a bad idea
--> $DIR/attrs.rs:9:1
--> $DIR/attrs.rs:8:1
|
LL | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::inline-always` implied by `-D warnings`

error: the since field must contain a semver-compliant version
--> $DIR/attrs.rs:29:14
--> $DIR/attrs.rs:28:14
|
LL | #[deprecated(since = "forever")]
| ^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::deprecated-semver` implied by `-D warnings`

error: the since field must contain a semver-compliant version
--> $DIR/attrs.rs:32:14
--> $DIR/attrs.rs:31:14
|
LL | #[deprecated(since = "1")]
| ^^^^^^^^^^^
Expand All @@ -37,13 +37,5 @@ LL | #![deny(clippy::restriction)]
|
= help: try enabling only the lints you really need

error: restriction lints are not meant to be all enabled
--> $DIR/attrs.rs:6:11
|
LL | #![forbid(clippy::restriction)]
| ^^^^^^^^^^^^^^^^^^^
|
= help: try enabling only the lints you really need

error: aborting due to 6 previous errors
error: aborting due to 5 previous errors

0 comments on commit 5747c15

Please sign in to comment.