about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2025-07-14 17:31:41 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2025-08-05 15:28:49 +0300
commit33cb4190a2a0e9cb9745dccd43e4f97d62f49c21 (patch)
tree01f12b4b85c6642f8ab84b14176e6da4a2d92b66
parent0f353363965ebf05e0757f7679c800b39c51a07e (diff)
downloadrust-33cb4190a2a0e9cb9745dccd43e4f97d62f49c21.tar.gz
rust-33cb4190a2a0e9cb9745dccd43e4f97d62f49c21.zip
Mark all deprecation lints in name resolution as deny-by-default and report-in-deps
-rw-r--r--compiler/rustc_lint_defs/src/builtin.rs12
-rw-r--r--tests/ui/attributes/key-value-expansion-scope.rs12
-rw-r--r--tests/ui/attributes/key-value-expansion-scope.stderr88
-rw-r--r--tests/ui/extern/issue-80074.rs2
-rw-r--r--tests/ui/extern/issue-80074.stderr17
-rw-r--r--tests/ui/imports/local-modularized-tricky-fail-2.stderr44
-rw-r--r--tests/ui/proc-macro/derive-helper-shadowing.rs2
-rw-r--r--tests/ui/proc-macro/derive-helper-shadowing.stderr20
-rw-r--r--tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.rs2
-rw-r--r--tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.stderr20
-rw-r--r--tests/ui/proc-macro/issue-75930-derive-cfg.rs2
-rw-r--r--tests/ui/proc-macro/issue-75930-derive-cfg.stderr42
-rw-r--r--tests/ui/proc-macro/proc-macro-attributes.rs8
-rw-r--r--tests/ui/proc-macro/proc-macro-attributes.stderr68
14 files changed, 297 insertions, 42 deletions
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs
index 3b84c6b6110..e3c9a65cd60 100644
--- a/compiler/rustc_lint_defs/src/builtin.rs
+++ b/compiler/rustc_lint_defs/src/builtin.rs
@@ -2156,6 +2156,7 @@ declare_lint! {
     @future_incompatible = FutureIncompatibleInfo {
         reason: FutureIncompatibilityReason::FutureReleaseError,
         reference: "issue #52234 <https://github.com/rust-lang/rust/issues/52234>",
+        report_in_deps: true,
     };
     crate_level_only
 }
@@ -2887,11 +2888,12 @@ declare_lint! {
     /// struct S { /* fields */ }
     /// ```
     pub LEGACY_DERIVE_HELPERS,
-    Warn,
+    Deny,
     "detects derive helper attributes that are used before they are introduced",
     @future_incompatible = FutureIncompatibleInfo {
         reason: FutureIncompatibilityReason::FutureReleaseError,
         reference: "issue #79202 <https://github.com/rust-lang/rust/issues/79202>",
+        report_in_deps: true,
     };
 }
 
@@ -4624,11 +4626,12 @@ declare_lint! {
     ///
     /// [future-incompatible]: ../index.md#future-incompatible-lints
     pub PRIVATE_MACRO_USE,
-    Warn,
+    Deny,
     "detects certain macro bindings that should not be re-exported",
     @future_incompatible = FutureIncompatibleInfo {
         reason: FutureIncompatibilityReason::FutureReleaseError,
         reference: "issue #120192 <https://github.com/rust-lang/rust/issues/120192>",
+        report_in_deps: true,
     };
 }
 
@@ -4828,7 +4831,7 @@ declare_lint! {
     ///
     /// ### Example
     ///
-    /// ```rust
+    /// ```rust,compile_fail
     /// #![doc = in_root!()]
     ///
     /// macro_rules! in_root { () => { "" } }
@@ -4853,11 +4856,12 @@ declare_lint! {
     ///
     /// [future-incompatible]: ../index.md#future-incompatible-lints
     pub OUT_OF_SCOPE_MACRO_CALLS,
-    Warn,
+    Deny,
     "detects out of scope calls to `macro_rules` in key-value attributes",
     @future_incompatible = FutureIncompatibleInfo {
         reason: FutureIncompatibilityReason::FutureReleaseError,
         reference: "issue #124535 <https://github.com/rust-lang/rust/issues/124535>",
+        report_in_deps: true,
     };
 }
 
diff --git a/tests/ui/attributes/key-value-expansion-scope.rs b/tests/ui/attributes/key-value-expansion-scope.rs
index 49a59502377..6688d698f9e 100644
--- a/tests/ui/attributes/key-value-expansion-scope.rs
+++ b/tests/ui/attributes/key-value-expansion-scope.rs
@@ -1,7 +1,7 @@
-#![doc = in_root!()] //~ WARN cannot find macro `in_root`
+#![doc = in_root!()] //~ ERROR cannot find macro `in_root`
                      //~| WARN this was previously accepted by the compiler
 #![doc = in_mod!()] //~ ERROR cannot find macro `in_mod` in this scope
-#![doc = in_mod_escape!()] //~ WARN cannot find macro `in_mod_escape`
+#![doc = in_mod_escape!()] //~ ERROR cannot find macro `in_mod_escape`
                            //~| WARN this was previously accepted by the compiler
 #![doc = in_block!()] //~ ERROR cannot find macro `in_block` in this scope
 
@@ -18,10 +18,10 @@ fn before() {
 
 macro_rules! in_root { () => { "" } }
 
-#[doc = in_mod!()] //~ WARN cannot find macro `in_mod`
+#[doc = in_mod!()] //~ ERROR cannot find macro `in_mod`
                    //~| WARN this was previously accepted by the compiler
 mod macros_stay {
-    #![doc = in_mod!()] //~ WARN cannot find macro `in_mod`
+    #![doc = in_mod!()] //~ ERROR cannot find macro `in_mod`
                         //~| WARN this was previously accepted by the compiler
 
     macro_rules! in_mod { () => { "" } }
@@ -33,10 +33,10 @@ mod macros_stay {
 }
 
 #[macro_use]
-#[doc = in_mod_escape!()] //~ WARN cannot find macro `in_mod_escape`
+#[doc = in_mod_escape!()] //~ ERROR cannot find macro `in_mod_escape`
                           //~| WARN this was previously accepted by the compiler
 mod macros_escape {
-    #![doc = in_mod_escape!()] //~ WARN cannot find macro `in_mod_escape`
+    #![doc = in_mod_escape!()] //~ ERROR cannot find macro `in_mod_escape`
                                //~| WARN this was previously accepted by the compiler
 
     macro_rules! in_mod_escape { () => { "" } }
diff --git a/tests/ui/attributes/key-value-expansion-scope.stderr b/tests/ui/attributes/key-value-expansion-scope.stderr
index 91a602e57d9..29b48ca4ce6 100644
--- a/tests/ui/attributes/key-value-expansion-scope.stderr
+++ b/tests/ui/attributes/key-value-expansion-scope.stderr
@@ -126,7 +126,7 @@ LL |     #![doc = in_block!()]
    |
    = help: have you added the `#[macro_use]` on the module/import?
 
-warning: cannot find macro `in_root` in the current scope when looking from the crate root
+error: cannot find macro `in_root` in the current scope when looking from the crate root
   --> $DIR/key-value-expansion-scope.rs:1:10
    |
 LL | #![doc = in_root!()]
@@ -135,9 +135,9 @@ LL | #![doc = in_root!()]
    = 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 #124535 <https://github.com/rust-lang/rust/issues/124535>
    = help: import `macro_rules` with `use` to make it callable above its definition
-   = note: `#[warn(out_of_scope_macro_calls)]` on by default
+   = note: `#[deny(out_of_scope_macro_calls)]` on by default
 
-warning: cannot find macro `in_mod_escape` in the current scope when looking from the crate root
+error: cannot find macro `in_mod_escape` in the current scope when looking from the crate root
   --> $DIR/key-value-expansion-scope.rs:4:10
    |
 LL | #![doc = in_mod_escape!()]
@@ -147,7 +147,7 @@ LL | #![doc = in_mod_escape!()]
    = note: for more information, see issue #124535 <https://github.com/rust-lang/rust/issues/124535>
    = help: import `macro_rules` with `use` to make it callable above its definition
 
-warning: cannot find macro `in_mod` in the current scope when looking from module `macros_stay`
+error: cannot find macro `in_mod` in the current scope when looking from module `macros_stay`
   --> $DIR/key-value-expansion-scope.rs:21:9
    |
 LL | #[doc = in_mod!()]
@@ -157,7 +157,7 @@ LL | #[doc = in_mod!()]
    = note: for more information, see issue #124535 <https://github.com/rust-lang/rust/issues/124535>
    = help: import `macro_rules` with `use` to make it callable above its definition
 
-warning: cannot find macro `in_mod` in the current scope when looking from module `macros_stay`
+error: cannot find macro `in_mod` in the current scope when looking from module `macros_stay`
   --> $DIR/key-value-expansion-scope.rs:24:14
    |
 LL |     #![doc = in_mod!()]
@@ -167,7 +167,7 @@ LL |     #![doc = in_mod!()]
    = note: for more information, see issue #124535 <https://github.com/rust-lang/rust/issues/124535>
    = help: import `macro_rules` with `use` to make it callable above its definition
 
-warning: cannot find macro `in_mod_escape` in the current scope when looking from module `macros_escape`
+error: cannot find macro `in_mod_escape` in the current scope when looking from module `macros_escape`
   --> $DIR/key-value-expansion-scope.rs:36:9
    |
 LL | #[doc = in_mod_escape!()]
@@ -177,7 +177,7 @@ LL | #[doc = in_mod_escape!()]
    = note: for more information, see issue #124535 <https://github.com/rust-lang/rust/issues/124535>
    = help: import `macro_rules` with `use` to make it callable above its definition
 
-warning: cannot find macro `in_mod_escape` in the current scope when looking from module `macros_escape`
+error: cannot find macro `in_mod_escape` in the current scope when looking from module `macros_escape`
   --> $DIR/key-value-expansion-scope.rs:39:14
    |
 LL |     #![doc = in_mod_escape!()]
@@ -187,5 +187,77 @@ LL |     #![doc = in_mod_escape!()]
    = note: for more information, see issue #124535 <https://github.com/rust-lang/rust/issues/124535>
    = help: import `macro_rules` with `use` to make it callable above its definition
 
-error: aborting due to 16 previous errors; 6 warnings emitted
+error: aborting due to 22 previous errors
+
+Future incompatibility report: Future breakage diagnostic:
+error: cannot find macro `in_root` in the current scope when looking from the crate root
+  --> $DIR/key-value-expansion-scope.rs:1:10
+   |
+LL | #![doc = in_root!()]
+   |          ^^^^^^^ not found from the crate root
+   |
+   = 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 #124535 <https://github.com/rust-lang/rust/issues/124535>
+   = help: import `macro_rules` with `use` to make it callable above its definition
+   = note: `#[deny(out_of_scope_macro_calls)]` on by default
+
+Future breakage diagnostic:
+error: cannot find macro `in_mod_escape` in the current scope when looking from the crate root
+  --> $DIR/key-value-expansion-scope.rs:4:10
+   |
+LL | #![doc = in_mod_escape!()]
+   |          ^^^^^^^^^^^^^ not found from the crate root
+   |
+   = 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 #124535 <https://github.com/rust-lang/rust/issues/124535>
+   = help: import `macro_rules` with `use` to make it callable above its definition
+   = note: `#[deny(out_of_scope_macro_calls)]` on by default
+
+Future breakage diagnostic:
+error: cannot find macro `in_mod` in the current scope when looking from module `macros_stay`
+  --> $DIR/key-value-expansion-scope.rs:21:9
+   |
+LL | #[doc = in_mod!()]
+   |         ^^^^^^ not found from module `macros_stay`
+   |
+   = 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 #124535 <https://github.com/rust-lang/rust/issues/124535>
+   = help: import `macro_rules` with `use` to make it callable above its definition
+   = note: `#[deny(out_of_scope_macro_calls)]` on by default
+
+Future breakage diagnostic:
+error: cannot find macro `in_mod` in the current scope when looking from module `macros_stay`
+  --> $DIR/key-value-expansion-scope.rs:24:14
+   |
+LL |     #![doc = in_mod!()]
+   |              ^^^^^^ not found from module `macros_stay`
+   |
+   = 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 #124535 <https://github.com/rust-lang/rust/issues/124535>
+   = help: import `macro_rules` with `use` to make it callable above its definition
+   = note: `#[deny(out_of_scope_macro_calls)]` on by default
+
+Future breakage diagnostic:
+error: cannot find macro `in_mod_escape` in the current scope when looking from module `macros_escape`
+  --> $DIR/key-value-expansion-scope.rs:36:9
+   |
+LL | #[doc = in_mod_escape!()]
+   |         ^^^^^^^^^^^^^ not found from module `macros_escape`
+   |
+   = 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 #124535 <https://github.com/rust-lang/rust/issues/124535>
+   = help: import `macro_rules` with `use` to make it callable above its definition
+   = note: `#[deny(out_of_scope_macro_calls)]` on by default
+
+Future breakage diagnostic:
+error: cannot find macro `in_mod_escape` in the current scope when looking from module `macros_escape`
+  --> $DIR/key-value-expansion-scope.rs:39:14
+   |
+LL |     #![doc = in_mod_escape!()]
+   |              ^^^^^^^^^^^^^ not found from module `macros_escape`
+   |
+   = 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 #124535 <https://github.com/rust-lang/rust/issues/124535>
+   = help: import `macro_rules` with `use` to make it callable above its definition
+   = note: `#[deny(out_of_scope_macro_calls)]` on by default
 
diff --git a/tests/ui/extern/issue-80074.rs b/tests/ui/extern/issue-80074.rs
index ba7b55a450f..942b78916d6 100644
--- a/tests/ui/extern/issue-80074.rs
+++ b/tests/ui/extern/issue-80074.rs
@@ -11,7 +11,7 @@ extern crate issue_80074_2;
 
 fn main() {
     foo!();
-    //~^ WARN: macro `foo` is private
+    //~^ ERROR: macro `foo` is private
     //~| WARN: it will become a hard error in a future release!
     bar!();
     //~^ ERROR: cannot find macro `bar` in this scope
diff --git a/tests/ui/extern/issue-80074.stderr b/tests/ui/extern/issue-80074.stderr
index b30b761593e..510ca1be0a1 100644
--- a/tests/ui/extern/issue-80074.stderr
+++ b/tests/ui/extern/issue-80074.stderr
@@ -16,7 +16,7 @@ error: cannot find macro `m` in this scope
 LL |     m!();
    |     ^
 
-warning: macro `foo` is private
+error: macro `foo` is private
   --> $DIR/issue-80074.rs:13:5
    |
 LL |     foo!();
@@ -24,8 +24,19 @@ LL |     foo!();
    |
    = 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 #120192 <https://github.com/rust-lang/rust/issues/120192>
-   = note: `#[warn(private_macro_use)]` on by default
+   = note: `#[deny(private_macro_use)]` on by default
 
-error: aborting due to 3 previous errors; 1 warning emitted
+error: aborting due to 4 previous errors
 
 For more information about this error, try `rustc --explain E0469`.
+Future incompatibility report: Future breakage diagnostic:
+error: macro `foo` is private
+  --> $DIR/issue-80074.rs:13:5
+   |
+LL |     foo!();
+   |     ^^^
+   |
+   = 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 #120192 <https://github.com/rust-lang/rust/issues/120192>
+   = note: `#[deny(private_macro_use)]` on by default
+
diff --git a/tests/ui/imports/local-modularized-tricky-fail-2.stderr b/tests/ui/imports/local-modularized-tricky-fail-2.stderr
index 49f5c72947f..ea4056b3d75 100644
--- a/tests/ui/imports/local-modularized-tricky-fail-2.stderr
+++ b/tests/ui/imports/local-modularized-tricky-fail-2.stderr
@@ -41,3 +41,47 @@ LL |   define_exported!();
 
 error: aborting due to 2 previous errors
 
+Future incompatibility report: Future breakage diagnostic:
+error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths
+  --> $DIR/local-modularized-tricky-fail-2.rs:13:9
+   |
+LL |     use crate::exported;
+   |         ^^^^^^^^^^^^^^^
+   |
+   = 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 #52234 <https://github.com/rust-lang/rust/issues/52234>
+note: the macro is defined here
+  --> $DIR/local-modularized-tricky-fail-2.rs:5:5
+   |
+LL | /     macro_rules! exported {
+LL | |         () => ()
+LL | |     }
+   | |_____^
+...
+LL |   define_exported!();
+   |   ------------------ in this macro invocation
+   = note: `#[deny(macro_expanded_macro_exports_accessed_by_absolute_paths)]` on by default
+   = note: this error originates in the macro `define_exported` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+Future breakage diagnostic:
+error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths
+  --> $DIR/local-modularized-tricky-fail-2.rs:19:5
+   |
+LL |     crate::exported!();
+   |     ^^^^^^^^^^^^^^^
+   |
+   = 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 #52234 <https://github.com/rust-lang/rust/issues/52234>
+note: the macro is defined here
+  --> $DIR/local-modularized-tricky-fail-2.rs:5:5
+   |
+LL | /     macro_rules! exported {
+LL | |         () => ()
+LL | |     }
+   | |_____^
+...
+LL |   define_exported!();
+   |   ------------------ in this macro invocation
+   = note: `#[deny(macro_expanded_macro_exports_accessed_by_absolute_paths)]` on by default
+   = note: this error originates in the macro `define_exported` (in Nightly builds, run with -Z macro-backtrace for more info)
+
diff --git a/tests/ui/proc-macro/derive-helper-shadowing.rs b/tests/ui/proc-macro/derive-helper-shadowing.rs
index e774e464053..ee883be3352 100644
--- a/tests/ui/proc-macro/derive-helper-shadowing.rs
+++ b/tests/ui/proc-macro/derive-helper-shadowing.rs
@@ -17,7 +17,7 @@ macro_rules! gen_helper_use {
 }
 
 #[empty_helper] //~ ERROR `empty_helper` is ambiguous
-                //~| WARN derive helper attribute is used before it is introduced
+                //~| ERROR derive helper attribute is used before it is introduced
                 //~| WARN this was previously accepted
 #[derive(Empty)]
 struct S {
diff --git a/tests/ui/proc-macro/derive-helper-shadowing.stderr b/tests/ui/proc-macro/derive-helper-shadowing.stderr
index 1206778bb23..65989375ab5 100644
--- a/tests/ui/proc-macro/derive-helper-shadowing.stderr
+++ b/tests/ui/proc-macro/derive-helper-shadowing.stderr
@@ -58,7 +58,7 @@ LL | use test_macros::empty_attr as empty_helper;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: use `crate::empty_helper` to refer to this attribute macro unambiguously
 
-warning: derive helper attribute is used before it is introduced
+error: derive helper attribute is used before it is introduced
   --> $DIR/derive-helper-shadowing.rs:19:3
    |
 LL | #[empty_helper]
@@ -69,8 +69,22 @@ LL | #[derive(Empty)]
    |
    = 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 #79202 <https://github.com/rust-lang/rust/issues/79202>
-   = note: `#[warn(legacy_derive_helpers)]` on by default
+   = note: `#[deny(legacy_derive_helpers)]` on by default
 
-error: aborting due to 4 previous errors; 1 warning emitted
+error: aborting due to 5 previous errors
 
 For more information about this error, try `rustc --explain E0659`.
+Future incompatibility report: Future breakage diagnostic:
+error: derive helper attribute is used before it is introduced
+  --> $DIR/derive-helper-shadowing.rs:19:3
+   |
+LL | #[empty_helper]
+   |   ^^^^^^^^^^^^
+...
+LL | #[derive(Empty)]
+   |          ----- the attribute is introduced here
+   |
+   = 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 #79202 <https://github.com/rust-lang/rust/issues/79202>
+   = note: `#[deny(legacy_derive_helpers)]` on by default
+
diff --git a/tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.rs b/tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.rs
index 1197dd7f3bf..97c81e9945d 100644
--- a/tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.rs
+++ b/tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.rs
@@ -5,7 +5,7 @@ extern crate test_macros;
 use test_macros::empty_attr as empty_helper;
 
 #[empty_helper] //~ ERROR `empty_helper` is ambiguous
-                //~| WARN derive helper attribute is used before it is introduced
+                //~| ERROR derive helper attribute is used before it is introduced
                 //~| WARN this was previously accepted
 #[derive(Empty)]
 struct S;
diff --git a/tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.stderr b/tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.stderr
index 1c12a2804c6..df7951464fb 100644
--- a/tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.stderr
+++ b/tests/ui/proc-macro/helper-attr-blocked-by-import-ambig.stderr
@@ -17,7 +17,7 @@ LL | use test_macros::empty_attr as empty_helper;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: use `crate::empty_helper` to refer to this attribute macro unambiguously
 
-warning: derive helper attribute is used before it is introduced
+error: derive helper attribute is used before it is introduced
   --> $DIR/helper-attr-blocked-by-import-ambig.rs:7:3
    |
 LL | #[empty_helper]
@@ -28,8 +28,22 @@ LL | #[derive(Empty)]
    |
    = 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 #79202 <https://github.com/rust-lang/rust/issues/79202>
-   = note: `#[warn(legacy_derive_helpers)]` on by default
+   = note: `#[deny(legacy_derive_helpers)]` on by default
 
-error: aborting due to 1 previous error; 1 warning emitted
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0659`.
+Future incompatibility report: Future breakage diagnostic:
+error: derive helper attribute is used before it is introduced
+  --> $DIR/helper-attr-blocked-by-import-ambig.rs:7:3
+   |
+LL | #[empty_helper]
+   |   ^^^^^^^^^^^^
+...
+LL | #[derive(Empty)]
+   |          ----- the attribute is introduced here
+   |
+   = 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 #79202 <https://github.com/rust-lang/rust/issues/79202>
+   = note: `#[deny(legacy_derive_helpers)]` on by default
+
diff --git a/tests/ui/proc-macro/issue-75930-derive-cfg.rs b/tests/ui/proc-macro/issue-75930-derive-cfg.rs
index f0851b31e9c..e8df1a66dd9 100644
--- a/tests/ui/proc-macro/issue-75930-derive-cfg.rs
+++ b/tests/ui/proc-macro/issue-75930-derive-cfg.rs
@@ -6,7 +6,7 @@
 // Tests that we cfg-strip all targets before invoking
 // a derive macro
 // FIXME: We currently lose spans here (see issue #43081)
-
+#![warn(legacy_derive_helpers)]
 #![no_std] // Don't load unnecessary hygiene information from std
 extern crate std;
 
diff --git a/tests/ui/proc-macro/issue-75930-derive-cfg.stderr b/tests/ui/proc-macro/issue-75930-derive-cfg.stderr
index df1e36d7390..906e9c6bf69 100644
--- a/tests/ui/proc-macro/issue-75930-derive-cfg.stderr
+++ b/tests/ui/proc-macro/issue-75930-derive-cfg.stderr
@@ -9,7 +9,11 @@ LL | #[derive(Print)]
    |
    = 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 #79202 <https://github.com/rust-lang/rust/issues/79202>
-   = note: `#[warn(legacy_derive_helpers)]` on by default
+note: the lint level is defined here
+  --> $DIR/issue-75930-derive-cfg.rs:9:9
+   |
+LL | #![warn(legacy_derive_helpers)]
+   |         ^^^^^^^^^^^^^^^^^^^^^
 
 warning: derive helper attribute is used before it is introduced
   --> $DIR/issue-75930-derive-cfg.rs:46:3
@@ -26,3 +30,39 @@ LL | #[derive(Print)]
 
 warning: 2 warnings emitted
 
+Future incompatibility report: Future breakage diagnostic:
+warning: derive helper attribute is used before it is introduced
+  --> $DIR/issue-75930-derive-cfg.rs:46:3
+   |
+LL | #[print_helper(a)]
+   |   ^^^^^^^^^^^^
+...
+LL | #[derive(Print)]
+   |          ----- the attribute is introduced here
+   |
+   = 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 #79202 <https://github.com/rust-lang/rust/issues/79202>
+note: the lint level is defined here
+  --> $DIR/issue-75930-derive-cfg.rs:9:9
+   |
+LL | #![warn(legacy_derive_helpers)]
+   |         ^^^^^^^^^^^^^^^^^^^^^
+
+Future breakage diagnostic:
+warning: derive helper attribute is used before it is introduced
+  --> $DIR/issue-75930-derive-cfg.rs:46:3
+   |
+LL | #[print_helper(a)]
+   |   ^^^^^^^^^^^^
+...
+LL | #[derive(Print)]
+   |          ----- the attribute is introduced here
+   |
+   = 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 #79202 <https://github.com/rust-lang/rust/issues/79202>
+note: the lint level is defined here
+  --> $DIR/issue-75930-derive-cfg.rs:9:9
+   |
+LL | #![warn(legacy_derive_helpers)]
+   |         ^^^^^^^^^^^^^^^^^^^^^
+
diff --git a/tests/ui/proc-macro/proc-macro-attributes.rs b/tests/ui/proc-macro/proc-macro-attributes.rs
index 455fcc56e58..f1270b896aa 100644
--- a/tests/ui/proc-macro/proc-macro-attributes.rs
+++ b/tests/ui/proc-macro/proc-macro-attributes.rs
@@ -4,17 +4,17 @@
 extern crate derive_b;
 
 #[B] //~ ERROR `B` is ambiguous
-     //~| WARN derive helper attribute is used before it is introduced
+     //~| ERROR derive helper attribute is used before it is introduced
      //~| WARN this was previously accepted
 #[C] //~ ERROR cannot find attribute `C` in this scope
 #[B(D)] //~ ERROR `B` is ambiguous
-        //~| WARN derive helper attribute is used before it is introduced
+        //~| ERROR derive helper attribute is used before it is introduced
         //~| WARN this was previously accepted
 #[B(E = "foo")] //~ ERROR `B` is ambiguous
-                //~| WARN derive helper attribute is used before it is introduced
+                //~| ERROR derive helper attribute is used before it is introduced
                 //~| WARN this was previously accepted
 #[B(arbitrary tokens)] //~ ERROR `B` is ambiguous
-                       //~| WARN derive helper attribute is used before it is introduced
+                       //~| ERROR derive helper attribute is used before it is introduced
                        //~| WARN this was previously accepted
 #[derive(B)]
 struct B;
diff --git a/tests/ui/proc-macro/proc-macro-attributes.stderr b/tests/ui/proc-macro/proc-macro-attributes.stderr
index 140d8790690..2cc57383eb3 100644
--- a/tests/ui/proc-macro/proc-macro-attributes.stderr
+++ b/tests/ui/proc-macro/proc-macro-attributes.stderr
@@ -76,7 +76,7 @@ note: `B` could also refer to the derive macro imported here
 LL | #[macro_use]
    | ^^^^^^^^^^^^
 
-warning: derive helper attribute is used before it is introduced
+error: derive helper attribute is used before it is introduced
   --> $DIR/proc-macro-attributes.rs:6:3
    |
 LL | #[B]
@@ -87,9 +87,9 @@ LL | #[derive(B)]
    |
    = 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 #79202 <https://github.com/rust-lang/rust/issues/79202>
-   = note: `#[warn(legacy_derive_helpers)]` on by default
+   = note: `#[deny(legacy_derive_helpers)]` on by default
 
-warning: derive helper attribute is used before it is introduced
+error: derive helper attribute is used before it is introduced
   --> $DIR/proc-macro-attributes.rs:10:3
    |
 LL | #[B(D)]
@@ -101,7 +101,7 @@ LL | #[derive(B)]
    = 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 #79202 <https://github.com/rust-lang/rust/issues/79202>
 
-warning: derive helper attribute is used before it is introduced
+error: derive helper attribute is used before it is introduced
   --> $DIR/proc-macro-attributes.rs:13:3
    |
 LL | #[B(E = "foo")]
@@ -113,7 +113,7 @@ LL | #[derive(B)]
    = 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 #79202 <https://github.com/rust-lang/rust/issues/79202>
 
-warning: derive helper attribute is used before it is introduced
+error: derive helper attribute is used before it is introduced
   --> $DIR/proc-macro-attributes.rs:16:3
    |
 LL | #[B(arbitrary tokens)]
@@ -125,6 +125,62 @@ LL | #[derive(B)]
    = 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 #79202 <https://github.com/rust-lang/rust/issues/79202>
 
-error: aborting due to 5 previous errors; 4 warnings emitted
+error: aborting due to 9 previous errors
 
 For more information about this error, try `rustc --explain E0659`.
+Future incompatibility report: Future breakage diagnostic:
+error: derive helper attribute is used before it is introduced
+  --> $DIR/proc-macro-attributes.rs:6:3
+   |
+LL | #[B]
+   |   ^
+...
+LL | #[derive(B)]
+   |          - the attribute is introduced here
+   |
+   = 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 #79202 <https://github.com/rust-lang/rust/issues/79202>
+   = note: `#[deny(legacy_derive_helpers)]` on by default
+
+Future breakage diagnostic:
+error: derive helper attribute is used before it is introduced
+  --> $DIR/proc-macro-attributes.rs:10:3
+   |
+LL | #[B(D)]
+   |   ^
+...
+LL | #[derive(B)]
+   |          - the attribute is introduced here
+   |
+   = 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 #79202 <https://github.com/rust-lang/rust/issues/79202>
+   = note: `#[deny(legacy_derive_helpers)]` on by default
+
+Future breakage diagnostic:
+error: derive helper attribute is used before it is introduced
+  --> $DIR/proc-macro-attributes.rs:13:3
+   |
+LL | #[B(E = "foo")]
+   |   ^
+...
+LL | #[derive(B)]
+   |          - the attribute is introduced here
+   |
+   = 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 #79202 <https://github.com/rust-lang/rust/issues/79202>
+   = note: `#[deny(legacy_derive_helpers)]` on by default
+
+Future breakage diagnostic:
+error: derive helper attribute is used before it is introduced
+  --> $DIR/proc-macro-attributes.rs:16:3
+   |
+LL | #[B(arbitrary tokens)]
+   |   ^
+...
+LL | #[derive(B)]
+   |          - the attribute is introduced here
+   |
+   = 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 #79202 <https://github.com/rust-lang/rust/issues/79202>
+   = note: `#[deny(legacy_derive_helpers)]` on by default
+