Skip to content

Commit 9e8eb73

Browse files
committed
Remove wrong exception text for non-local macro_rules!
1 parent 93b34c2 commit 9e8eb73

File tree

5 files changed

+0
-8
lines changed

5 files changed

+0
-8
lines changed

compiler/rustc_lint/messages.ftl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,6 @@ lint_non_local_definitions_macro_rules = non-local `macro_rules!` definition, `#
563563
.help_doctest =
564564
remove the `#[macro_export]` or make this doc-test a standalone test with its own `fn main() {"{"} ... {"}"}`
565565
.non_local = a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
566-
.exception = one exception to the rule are anon-const (`const _: () = {"{"} ... {"}"}`) at top-level module
567566
568567
lint_non_local_definitions_may_move = may need to be moved as well
569568

compiler/rustc_lint/src/lints.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,6 @@ impl<'a> LintDiagnostic<'a, ()> for NonLocalDefinitionsDiag {
14301430
}
14311431

14321432
diag.note(fluent::lint_non_local);
1433-
diag.note(fluent::lint_exception);
14341433
diag.note(fluent::lint_non_local_definitions_deprecation);
14351434

14361435
if let Some(cargo_update) = cargo_update {

tests/rustdoc-ui/doctest/non_local_defs.stderr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ LL | macro_rules! a_macro { () => {} }
66
|
77
= help: remove the `#[macro_export]` or make this doc-test a standalone test with its own `fn main() { ... }`
88
= note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
9-
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module
109
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
1110
= note: `#[warn(non_local_definitions)]` on by default
1211

tests/ui/lint/non-local-defs/macro_rules.stderr

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ LL | macro_rules! m0 { () => { } };
66
|
77
= help: remove the `#[macro_export]` or move this `macro_rules!` outside the of the current constant `B`
88
= note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
9-
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module
109
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
1110
= note: `#[warn(non_local_definitions)]` on by default
1211

@@ -18,7 +17,6 @@ LL | non_local_macro::non_local_macro_rules!(my_macro);
1817
|
1918
= help: remove the `#[macro_export]` or move this `macro_rules!` outside the of the current constant `_MACRO_EXPORT`
2019
= note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
21-
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module
2220
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
2321
= note: the macro `non_local_macro::non_local_macro_rules` may come from an old version of the `non_local_macro` crate, try updating your dependency with `cargo update -p non_local_macro`
2422
= note: this warning originates in the macro `non_local_macro::non_local_macro_rules` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -31,7 +29,6 @@ LL | macro_rules! m { () => { } };
3129
|
3230
= help: remove the `#[macro_export]` or move this `macro_rules!` outside the of the current function `main`
3331
= note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
34-
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module
3532
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
3633

3734
warning: non-local `macro_rules!` definition, `#[macro_export]` macro should be written at top level module
@@ -42,7 +39,6 @@ LL | macro_rules! m2 { () => { } };
4239
|
4340
= help: remove the `#[macro_export]` or move this `macro_rules!` outside the of the current associated function `bar` and up 2 bodies
4441
= note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
45-
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module
4642
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
4743

4844
warning: 4 warnings emitted

tests/ui/proc-macro/nested-macro-rules.stderr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ LL | nested_macro_rules::outer_macro!(SecondStruct, SecondAttrStruct);
1919
|
2020
= help: remove the `#[macro_export]` or move this `macro_rules!` outside the of the current function `main`
2121
= note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
22-
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module
2322
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
2423
note: the lint level is defined here
2524
--> $DIR/nested-macro-rules.rs:8:9

0 commit comments

Comments
 (0)