about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-02-04 21:10:34 +0100
committerGitHub <noreply@github.com>2021-02-04 21:10:34 +0100
commitc5990dd8ad83fa1dccbc105102bceca0728977c3 (patch)
tree27ba476a0bf0c21a66ed92779ad5855ea4faad6c /src/test/ui
parent5b0acfd049ca205a5a43adde9882f59a97107afd (diff)
parentb6b897b02c080759ec365d440d5df7cf93426657 (diff)
downloadrust-c5990dd8ad83fa1dccbc105102bceca0728977c3.tar.gz
rust-c5990dd8ad83fa1dccbc105102bceca0728977c3.zip
Rollup merge of #81556 - nikomatsakis:forbidden-lint-groups-lint, r=pnkfelix
introduce future-compatibility warning for forbidden lint groups

We used to ignore `forbid(group)` scenarios completely. This changed in #78864, but that led to a number of regressions (#80988, #81218).

This PR introduces a future compatibility warning for the case where a group is forbidden but then an individual lint within that group is allowed. We now issue a FCW when we see the "allow", but permit it to take effect.

r? ``@Mark-Simulacrum``
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/lint/forbid-group-group-1.rs13
-rw-r--r--src/test/ui/lint/forbid-group-group-1.stderr15
-rw-r--r--src/test/ui/lint/forbid-group-group-2.rs26
-rw-r--r--src/test/ui/lint/forbid-group-group-2.stderr115
-rw-r--r--src/test/ui/lint/forbid-group-member.rs19
-rw-r--r--src/test/ui/lint/forbid-group-member.stderr51
-rw-r--r--src/test/ui/lint/forbid-member-group.rs12
-rw-r--r--src/test/ui/lint/forbid-member-group.stderr30
-rw-r--r--src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs7
-rw-r--r--src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.stderr30
-rw-r--r--src/test/ui/lint/issue-80988.rs16
-rw-r--r--src/test/ui/lint/issue-80988.stderr51
-rw-r--r--src/test/ui/lint/issue-81218.rs14
-rw-r--r--src/test/ui/lint/outer-forbid.rs5
-rw-r--r--src/test/ui/lint/outer-forbid.stderr37
15 files changed, 417 insertions, 24 deletions
diff --git a/src/test/ui/lint/forbid-group-group-1.rs b/src/test/ui/lint/forbid-group-group-1.rs
new file mode 100644
index 00000000000..80f7db4e560
--- /dev/null
+++ b/src/test/ui/lint/forbid-group-group-1.rs
@@ -0,0 +1,13 @@
+// Check what happens when we forbid a smaller group but
+// then allow a superset of that group.
+
+#![forbid(nonstandard_style)]
+
+// FIXME: Arguably this should be an error, but the WARNINGS group is
+// treated in a very special (and rather ad-hoc) way and
+// it fails to trigger.
+#[allow(warnings)]
+fn main() {
+    let A: ();
+    //~^ ERROR should have a snake case name
+}
diff --git a/src/test/ui/lint/forbid-group-group-1.stderr b/src/test/ui/lint/forbid-group-group-1.stderr
new file mode 100644
index 00000000000..fd425e5f74e
--- /dev/null
+++ b/src/test/ui/lint/forbid-group-group-1.stderr
@@ -0,0 +1,15 @@
+error: variable `A` should have a snake case name
+  --> $DIR/forbid-group-group-1.rs:11:9
+   |
+LL |     let A: ();
+   |         ^ help: convert the identifier to snake case: `a`
+   |
+note: the lint level is defined here
+  --> $DIR/forbid-group-group-1.rs:4:11
+   |
+LL | #![forbid(nonstandard_style)]
+   |           ^^^^^^^^^^^^^^^^^
+   = note: `#[forbid(non_snake_case)]` implied by `#[forbid(nonstandard_style)]`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/lint/forbid-group-group-2.rs b/src/test/ui/lint/forbid-group-group-2.rs
new file mode 100644
index 00000000000..b12fd72da74
--- /dev/null
+++ b/src/test/ui/lint/forbid-group-group-2.rs
@@ -0,0 +1,26 @@
+// Check what happens when we forbid a bigger group but
+// then deny a subset of that group.
+
+#![forbid(warnings)]
+#![deny(forbidden_lint_groups)]
+
+#[allow(nonstandard_style)]
+//~^ ERROR incompatible with previous
+//~| WARNING previously accepted by the compiler
+//~| ERROR incompatible with previous
+//~| WARNING previously accepted by the compiler
+//~| ERROR incompatible with previous
+//~| WARNING previously accepted by the compiler
+//~| ERROR incompatible with previous
+//~| WARNING previously accepted by the compiler
+//~| ERROR incompatible with previous
+//~| WARNING previously accepted by the compiler
+//~| ERROR incompatible with previous
+//~| WARNING previously accepted by the compiler
+//~| ERROR incompatible with previous
+//~| WARNING previously accepted by the compiler
+//~| ERROR incompatible with previous
+//~| WARNING previously accepted by the compiler
+//~| ERROR incompatible with previous
+//~| WARNING previously accepted by the compiler
+fn main() {}
diff --git a/src/test/ui/lint/forbid-group-group-2.stderr b/src/test/ui/lint/forbid-group-group-2.stderr
new file mode 100644
index 00000000000..214e949c11a
--- /dev/null
+++ b/src/test/ui/lint/forbid-group-group-2.stderr
@@ -0,0 +1,115 @@
+error: allow(nonstandard_style) incompatible with previous forbid
+  --> $DIR/forbid-group-group-2.rs:7:9
+   |
+LL | #![forbid(warnings)]
+   |           -------- `forbid` level set here
+...
+LL | #[allow(nonstandard_style)]
+   |         ^^^^^^^^^^^^^^^^^ overruled by previous forbid
+   |
+note: the lint level is defined here
+  --> $DIR/forbid-group-group-2.rs:5:9
+   |
+LL | #![deny(forbidden_lint_groups)]
+   |         ^^^^^^^^^^^^^^^^^^^^^
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+error: allow(nonstandard_style) incompatible with previous forbid
+  --> $DIR/forbid-group-group-2.rs:7:9
+   |
+LL | #![forbid(warnings)]
+   |           -------- `forbid` level set here
+...
+LL | #[allow(nonstandard_style)]
+   |         ^^^^^^^^^^^^^^^^^ overruled by previous forbid
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+error: allow(nonstandard_style) incompatible with previous forbid
+  --> $DIR/forbid-group-group-2.rs:7:9
+   |
+LL | #![forbid(warnings)]
+   |           -------- `forbid` level set here
+...
+LL | #[allow(nonstandard_style)]
+   |         ^^^^^^^^^^^^^^^^^ overruled by previous forbid
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+error: allow(nonstandard_style) incompatible with previous forbid
+  --> $DIR/forbid-group-group-2.rs:7:9
+   |
+LL | #![forbid(warnings)]
+   |           -------- `forbid` level set here
+...
+LL | #[allow(nonstandard_style)]
+   |         ^^^^^^^^^^^^^^^^^ overruled by previous forbid
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+error: allow(nonstandard_style) incompatible with previous forbid
+  --> $DIR/forbid-group-group-2.rs:7:9
+   |
+LL | #![forbid(warnings)]
+   |           -------- `forbid` level set here
+...
+LL | #[allow(nonstandard_style)]
+   |         ^^^^^^^^^^^^^^^^^ overruled by previous forbid
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+error: allow(nonstandard_style) incompatible with previous forbid
+  --> $DIR/forbid-group-group-2.rs:7:9
+   |
+LL | #![forbid(warnings)]
+   |           -------- `forbid` level set here
+...
+LL | #[allow(nonstandard_style)]
+   |         ^^^^^^^^^^^^^^^^^ overruled by previous forbid
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+error: allow(nonstandard_style) incompatible with previous forbid
+  --> $DIR/forbid-group-group-2.rs:7:9
+   |
+LL | #![forbid(warnings)]
+   |           -------- `forbid` level set here
+...
+LL | #[allow(nonstandard_style)]
+   |         ^^^^^^^^^^^^^^^^^ overruled by previous forbid
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+error: allow(nonstandard_style) incompatible with previous forbid
+  --> $DIR/forbid-group-group-2.rs:7:9
+   |
+LL | #![forbid(warnings)]
+   |           -------- `forbid` level set here
+...
+LL | #[allow(nonstandard_style)]
+   |         ^^^^^^^^^^^^^^^^^ overruled by previous forbid
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+error: allow(nonstandard_style) incompatible with previous forbid
+  --> $DIR/forbid-group-group-2.rs:7:9
+   |
+LL | #![forbid(warnings)]
+   |           -------- `forbid` level set here
+...
+LL | #[allow(nonstandard_style)]
+   |         ^^^^^^^^^^^^^^^^^ overruled by previous forbid
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+error: aborting due to 9 previous errors
+
diff --git a/src/test/ui/lint/forbid-group-member.rs b/src/test/ui/lint/forbid-group-member.rs
new file mode 100644
index 00000000000..6f1b2e9f668
--- /dev/null
+++ b/src/test/ui/lint/forbid-group-member.rs
@@ -0,0 +1,19 @@
+// Check what happens when we forbid a group but
+// then allow a member of that group.
+//
+// check-pass
+
+#![forbid(unused)]
+
+#[allow(unused_variables)]
+//~^ WARNING incompatible with previous forbid
+//~| WARNING previously accepted
+//~| WARNING incompatible with previous forbid
+//~| WARNING previously accepted
+//~| WARNING incompatible with previous forbid
+//~| WARNING previously accepted
+//~| WARNING incompatible with previous forbid
+//~| WARNING previously accepted
+fn main() {
+    let a: ();
+}
diff --git a/src/test/ui/lint/forbid-group-member.stderr b/src/test/ui/lint/forbid-group-member.stderr
new file mode 100644
index 00000000000..c818d7ff606
--- /dev/null
+++ b/src/test/ui/lint/forbid-group-member.stderr
@@ -0,0 +1,51 @@
+warning: allow(unused_variables) incompatible with previous forbid
+  --> $DIR/forbid-group-member.rs:8:9
+   |
+LL | #![forbid(unused)]
+   |           ------ `forbid` level set here
+LL | 
+LL | #[allow(unused_variables)]
+   |         ^^^^^^^^^^^^^^^^ overruled by previous forbid
+   |
+   = note: `#[warn(forbidden_lint_groups)]` on by default
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+warning: allow(unused_variables) incompatible with previous forbid
+  --> $DIR/forbid-group-member.rs:8:9
+   |
+LL | #![forbid(unused)]
+   |           ------ `forbid` level set here
+LL | 
+LL | #[allow(unused_variables)]
+   |         ^^^^^^^^^^^^^^^^ overruled by previous forbid
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+warning: allow(unused_variables) incompatible with previous forbid
+  --> $DIR/forbid-group-member.rs:8:9
+   |
+LL | #![forbid(unused)]
+   |           ------ `forbid` level set here
+LL | 
+LL | #[allow(unused_variables)]
+   |         ^^^^^^^^^^^^^^^^ overruled by previous forbid
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+warning: allow(unused_variables) incompatible with previous forbid
+  --> $DIR/forbid-group-member.rs:8:9
+   |
+LL | #![forbid(unused)]
+   |           ------ `forbid` level set here
+LL | 
+LL | #[allow(unused_variables)]
+   |         ^^^^^^^^^^^^^^^^ overruled by previous forbid
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+warning: 4 warnings emitted
+
diff --git a/src/test/ui/lint/forbid-member-group.rs b/src/test/ui/lint/forbid-member-group.rs
new file mode 100644
index 00000000000..3279029a9cb
--- /dev/null
+++ b/src/test/ui/lint/forbid-member-group.rs
@@ -0,0 +1,12 @@
+// Check what happens when we forbid a member of
+// a group but then allow the group.
+
+#![forbid(unused_variables)]
+
+#[allow(unused)]
+//~^ ERROR incompatible with previous forbid
+//~| ERROR incompatible with previous forbid
+//~| ERROR incompatible with previous forbid
+fn main() {
+    let a: ();
+}
diff --git a/src/test/ui/lint/forbid-member-group.stderr b/src/test/ui/lint/forbid-member-group.stderr
new file mode 100644
index 00000000000..1d8ab4d5edb
--- /dev/null
+++ b/src/test/ui/lint/forbid-member-group.stderr
@@ -0,0 +1,30 @@
+error[E0453]: allow(unused) incompatible with previous forbid
+  --> $DIR/forbid-member-group.rs:6:9
+   |
+LL | #![forbid(unused_variables)]
+   |           ---------------- `forbid` level set here
+LL | 
+LL | #[allow(unused)]
+   |         ^^^^^^ overruled by previous forbid
+
+error[E0453]: allow(unused) incompatible with previous forbid
+  --> $DIR/forbid-member-group.rs:6:9
+   |
+LL | #![forbid(unused_variables)]
+   |           ---------------- `forbid` level set here
+LL | 
+LL | #[allow(unused)]
+   |         ^^^^^^ overruled by previous forbid
+
+error[E0453]: allow(unused) incompatible with previous forbid
+  --> $DIR/forbid-member-group.rs:6:9
+   |
+LL | #![forbid(unused_variables)]
+   |           ---------------- `forbid` level set here
+LL | 
+LL | #[allow(unused)]
+   |         ^^^^^^ overruled by previous forbid
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0453`.
diff --git a/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs b/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs
index f725304cf29..05d7d924c8f 100644
--- a/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs
+++ b/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs
@@ -14,14 +14,17 @@
 
 // compile-flags: -Z deduplicate-diagnostics=yes
 
+#![forbid(forbidden_lint_groups)]
+
 fn forbid_first(num: i32) -> i32 {
     #![forbid(unused)]
     #![deny(unused)]
     //~^ ERROR: deny(unused) incompatible with previous forbid
+    //~| WARNING being phased out
+    //~| ERROR: deny(unused) incompatible with previous forbid
+    //~| WARNING being phased out
     #![warn(unused)]
-    //~^ ERROR: warn(unused) incompatible with previous forbid
     #![allow(unused)]
-    //~^ ERROR: allow(unused) incompatible with previous forbid
 
     num * num
 }
diff --git a/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.stderr b/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.stderr
index 9f107411c10..475410cecff 100644
--- a/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.stderr
+++ b/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.stderr
@@ -1,29 +1,29 @@
-error[E0453]: deny(unused) incompatible with previous forbid
-  --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:19:13
+error: deny(unused) incompatible with previous forbid
+  --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:21:13
    |
 LL |     #![forbid(unused)]
    |               ------ `forbid` level set here
 LL |     #![deny(unused)]
    |             ^^^^^^ overruled by previous forbid
+   |
+note: the lint level is defined here
+  --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11
+   |
+LL | #![forbid(forbidden_lint_groups)]
+   |           ^^^^^^^^^^^^^^^^^^^^^
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
 
-error[E0453]: warn(unused) incompatible with previous forbid
+error: deny(unused) incompatible with previous forbid
   --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:21:13
    |
 LL |     #![forbid(unused)]
    |               ------ `forbid` level set here
-...
-LL |     #![warn(unused)]
+LL |     #![deny(unused)]
    |             ^^^^^^ overruled by previous forbid
-
-error[E0453]: allow(unused) incompatible with previous forbid
-  --> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:23:14
    |
-LL |     #![forbid(unused)]
-   |               ------ `forbid` level set here
-...
-LL |     #![allow(unused)]
-   |              ^^^^^^ overruled by previous forbid
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
 
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0453`.
diff --git a/src/test/ui/lint/issue-80988.rs b/src/test/ui/lint/issue-80988.rs
new file mode 100644
index 00000000000..16a041928db
--- /dev/null
+++ b/src/test/ui/lint/issue-80988.rs
@@ -0,0 +1,16 @@
+// Regression test for #80988
+//
+// check-pass
+
+#![forbid(warnings)]
+
+#[deny(warnings)]
+//~^ WARNING incompatible with previous forbid
+//~| WARNING being phased out
+//~| WARNING incompatible with previous forbid
+//~| WARNING being phased out
+//~| WARNING incompatible with previous forbid
+//~| WARNING being phased out
+//~| WARNING incompatible with previous forbid
+//~| WARNING being phased out
+fn main() {}
diff --git a/src/test/ui/lint/issue-80988.stderr b/src/test/ui/lint/issue-80988.stderr
new file mode 100644
index 00000000000..4cae11f97c0
--- /dev/null
+++ b/src/test/ui/lint/issue-80988.stderr
@@ -0,0 +1,51 @@
+warning: deny(warnings) incompatible with previous forbid
+  --> $DIR/issue-80988.rs:7:8
+   |
+LL | #![forbid(warnings)]
+   |           -------- `forbid` level set here
+LL | 
+LL | #[deny(warnings)]
+   |        ^^^^^^^^ overruled by previous forbid
+   |
+   = note: `#[warn(forbidden_lint_groups)]` on by default
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+warning: deny(warnings) incompatible with previous forbid
+  --> $DIR/issue-80988.rs:7:8
+   |
+LL | #![forbid(warnings)]
+   |           -------- `forbid` level set here
+LL | 
+LL | #[deny(warnings)]
+   |        ^^^^^^^^ overruled by previous forbid
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+warning: deny(warnings) incompatible with previous forbid
+  --> $DIR/issue-80988.rs:7:8
+   |
+LL | #![forbid(warnings)]
+   |           -------- `forbid` level set here
+LL | 
+LL | #[deny(warnings)]
+   |        ^^^^^^^^ overruled by previous forbid
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+warning: deny(warnings) incompatible with previous forbid
+  --> $DIR/issue-80988.rs:7:8
+   |
+LL | #![forbid(warnings)]
+   |           -------- `forbid` level set here
+LL | 
+LL | #[deny(warnings)]
+   |        ^^^^^^^^ overruled by previous forbid
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+warning: 4 warnings emitted
+
diff --git a/src/test/ui/lint/issue-81218.rs b/src/test/ui/lint/issue-81218.rs
new file mode 100644
index 00000000000..f02aa9040eb
--- /dev/null
+++ b/src/test/ui/lint/issue-81218.rs
@@ -0,0 +1,14 @@
+// Regression test for #81218
+//
+// check-pass
+
+#![forbid(warnings)]
+
+#[allow(unused_variables)]
+fn main() {
+    // We want to ensure that you don't get an error
+    // here. The idea is that a derive might generate
+    // code that would otherwise trigger the "unused variables"
+    // lint, but it is meant to be suppressed.
+    let x: ();
+}
diff --git a/src/test/ui/lint/outer-forbid.rs b/src/test/ui/lint/outer-forbid.rs
index d45848bf706..486ec3c4680 100644
--- a/src/test/ui/lint/outer-forbid.rs
+++ b/src/test/ui/lint/outer-forbid.rs
@@ -15,11 +15,16 @@
 // compile-flags: -Z deduplicate-diagnostics=yes
 
 #![forbid(unused, non_snake_case)]
+#![forbid(forbidden_lint_groups)]
 
 #[allow(unused_variables)] //~ ERROR incompatible with previous
+//~^ ERROR incompatible with previous
+//~| WARNING this was previously accepted by the compiler
+//~| WARNING this was previously accepted by the compiler
 fn foo() {}
 
 #[allow(unused)] //~ ERROR incompatible with previous
+//~^ WARNING this was previously accepted by the compiler
 fn bar() {}
 
 #[allow(nonstandard_style)] //~ ERROR incompatible with previous
diff --git a/src/test/ui/lint/outer-forbid.stderr b/src/test/ui/lint/outer-forbid.stderr
index c012c20697e..d69157a8bb3 100644
--- a/src/test/ui/lint/outer-forbid.stderr
+++ b/src/test/ui/lint/outer-forbid.stderr
@@ -1,23 +1,34 @@
-error[E0453]: allow(unused_variables) incompatible with previous forbid
-  --> $DIR/outer-forbid.rs:19:9
+error: allow(unused_variables) incompatible with previous forbid
+  --> $DIR/outer-forbid.rs:20:9
    |
 LL | #![forbid(unused, non_snake_case)]
    |           ------ `forbid` level set here
-LL | 
+...
 LL | #[allow(unused_variables)]
    |         ^^^^^^^^^^^^^^^^ overruled by previous forbid
+   |
+note: the lint level is defined here
+  --> $DIR/outer-forbid.rs:18:11
+   |
+LL | #![forbid(forbidden_lint_groups)]
+   |           ^^^^^^^^^^^^^^^^^^^^^
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
 
-error[E0453]: allow(unused) incompatible with previous forbid
-  --> $DIR/outer-forbid.rs:22:9
+error: allow(unused) incompatible with previous forbid
+  --> $DIR/outer-forbid.rs:26:9
    |
 LL | #![forbid(unused, non_snake_case)]
    |           ------ `forbid` level set here
 ...
 LL | #[allow(unused)]
    |         ^^^^^^ overruled by previous forbid
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
 
 error[E0453]: allow(nonstandard_style) incompatible with previous forbid
-  --> $DIR/outer-forbid.rs:25:9
+  --> $DIR/outer-forbid.rs:30:9
    |
 LL | #![forbid(unused, non_snake_case)]
    |                   -------------- `forbid` level set here
@@ -25,6 +36,18 @@ LL | #![forbid(unused, non_snake_case)]
 LL | #[allow(nonstandard_style)]
    |         ^^^^^^^^^^^^^^^^^ overruled by previous forbid
 
-error: aborting due to 3 previous errors
+error: allow(unused_variables) incompatible with previous forbid
+  --> $DIR/outer-forbid.rs:20:9
+   |
+LL | #![forbid(unused, non_snake_case)]
+   |           ------ `forbid` level set here
+...
+LL | #[allow(unused_variables)]
+   |         ^^^^^^^^^^^^^^^^ overruled by previous forbid
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+
+error: aborting due to 4 previous errors
 
 For more information about this error, try `rustc --explain E0453`.