about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2020-06-15 14:17:35 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2020-10-04 13:14:01 -0400
commit5747c15961da9d2d0b0dd775174d39f3b5961597 (patch)
treec78c599d06d8c91a119c2e5597d22d5ba3535338
parent840f7daaadb1222c4355dbb72cabdcf912cb8877 (diff)
downloadrust-5747c15961da9d2d0b0dd775174d39f3b5961597.tar.gz
rust-5747c15961da9d2d0b0dd775174d39f3b5961597.zip
Prevent forbid from being ignored if overriden at the same level.
That is, this changes `#[forbid(foo)] #[allow(foo)]` from allowing foo to
forbidding foo.
-rw-r--r--tests/ui/attrs.rs1
-rw-r--r--tests/ui/attrs.stderr16
2 files changed, 4 insertions, 13 deletions
diff --git a/tests/ui/attrs.rs b/tests/ui/attrs.rs
index 908d063729f..32685038067 100644
--- a/tests/ui/attrs.rs
+++ b/tests/ui/attrs.rs
@@ -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)]
diff --git a/tests/ui/attrs.stderr b/tests/ui/attrs.stderr
index ef4b89eaa6d..4324984dd60 100644
--- a/tests/ui/attrs.stderr
+++ b/tests/ui/attrs.stderr
@@ -1,5 +1,5 @@
 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)]
    | ^^^^^^^^^^^^^^^^^
@@ -7,7 +7,7 @@ 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")]
    |              ^^^^^^^^^^^^^^^^^
@@ -15,7 +15,7 @@ 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")]
    |              ^^^^^^^^^^^
@@ -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