Skip to content

Commit 2540ce8

Browse files
committed
Switch to more friendly main message
1 parent e6cd5f6 commit 2540ce8

12 files changed

+63
-63
lines changed

compiler/rustc_lint/messages.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ lint_non_local_definitions_cargo_update = the {$macro_kind} `{$macro_name}` may
440440
441441
lint_non_local_definitions_deprecation = 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>
442442
443-
lint_non_local_definitions_impl = non-local `impl` definition, they should be avoided as they go against expectation
443+
lint_non_local_definitions_impl = non-local `impl` definition, `impl` blocks should be written at the same level as their item
444444
.help =
445445
move this `impl` block outside the of the current {$body_kind_descr} {$depth ->
446446
[one] `{$body_name}`
@@ -450,7 +450,7 @@ lint_non_local_definitions_impl = non-local `impl` definition, they should be av
450450
.exception = one exception to the rule are anon-const (`const _: () = {"{"} ... {"}"}`) at top-level module and anon-const at the same nesting as the trait or type
451451
.const_anon = use a const-anon item to suppress this lint
452452
453-
lint_non_local_definitions_macro_rules = non-local `macro_rules!` definition, they should be avoided as they go against expectation
453+
lint_non_local_definitions_macro_rules = non-local `macro_rules!` definition, `#[macro_export]` macro should be written at top level module
454454
.help =
455455
remove the `#[macro_export]` or move this `macro_rules!` outside the of the current {$body_kind_descr} {$depth ->
456456
[one] `{$body_name}`

tests/rustdoc-ui/doctest/non_local_defs.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
warning: non-local `macro_rules!` definition, they should be avoided as they go against expectation
1+
warning: non-local `macro_rules!` definition, `#[macro_export]` macro should be written at top level module
22
--> $DIR/non_local_defs.rs:9:1
33
|
44
LL | macro_rules! a_macro { () => {} }

tests/ui/lint/non-local-defs/cargo-update.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
warning: non-local `impl` definition, they should be avoided as they go against expectation
1+
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
22
--> $DIR/cargo-update.rs:17:1
33
|
44
LL | non_local_macro::non_local_impl!(LocalStruct);

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
warning: non-local `impl` definition, they should be avoided as they go against expectation
1+
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
22
--> $DIR/consts.rs:13:5
33
|
44
LL | const Z: () = {
@@ -13,7 +13,7 @@ LL | impl Uto for &Test {}
1313
= 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>
1414
= note: `#[warn(non_local_definitions)]` on by default
1515

16-
warning: non-local `impl` definition, they should be avoided as they go against expectation
16+
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
1717
--> $DIR/consts.rs:24:5
1818
|
1919
LL | impl Uto2 for Test {}
@@ -24,7 +24,7 @@ LL | impl Uto2 for Test {}
2424
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
2525
= 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>
2626

27-
warning: non-local `impl` definition, they should be avoided as they go against expectation
27+
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
2828
--> $DIR/consts.rs:32:5
2929
|
3030
LL | impl Uto3 for Test {}
@@ -35,7 +35,7 @@ LL | impl Uto3 for Test {}
3535
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
3636
= 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>
3737

38-
warning: non-local `impl` definition, they should be avoided as they go against expectation
38+
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
3939
--> $DIR/consts.rs:43:5
4040
|
4141
LL | / impl Test {
@@ -49,7 +49,7 @@ LL | | }
4949
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
5050
= 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>
5151

52-
warning: non-local `impl` definition, they should be avoided as they go against expectation
52+
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
5353
--> $DIR/consts.rs:50:9
5454
|
5555
LL | / impl Test {
@@ -63,7 +63,7 @@ LL | | }
6363
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
6464
= 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>
6565

66-
warning: non-local `impl` definition, they should be avoided as they go against expectation
66+
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
6767
--> $DIR/consts.rs:59:9
6868
|
6969
LL | / impl Test {
@@ -77,7 +77,7 @@ LL | | }
7777
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
7878
= 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>
7979

80-
warning: non-local `impl` definition, they should be avoided as they go against expectation
80+
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
8181
--> $DIR/consts.rs:72:9
8282
|
8383
LL | impl Uto9 for Test {}
@@ -88,7 +88,7 @@ LL | impl Uto9 for Test {}
8888
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
8989
= 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>
9090

91-
warning: non-local `impl` definition, they should be avoided as they go against expectation
91+
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
9292
--> $DIR/consts.rs:79:9
9393
|
9494
LL | impl Uto10 for Test {}

tests/ui/lint/non-local-defs/exhaustive-trait.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
warning: non-local `impl` definition, they should be avoided as they go against expectation
1+
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
22
--> $DIR/exhaustive-trait.rs:7:5
33
|
44
LL | / impl PartialEq<()> for Dog {
@@ -15,7 +15,7 @@ LL | | }
1515
= 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>
1616
= note: `#[warn(non_local_definitions)]` on by default
1717

18-
warning: non-local `impl` definition, they should be avoided as they go against expectation
18+
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
1919
--> $DIR/exhaustive-trait.rs:14:5
2020
|
2121
LL | / impl PartialEq<()> for &Dog {
@@ -31,7 +31,7 @@ LL | | }
3131
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
3232
= 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>
3333

34-
warning: non-local `impl` definition, they should be avoided as they go against expectation
34+
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
3535
--> $DIR/exhaustive-trait.rs:21:5
3636
|
3737
LL | / impl PartialEq<Dog> for () {
@@ -47,7 +47,7 @@ LL | | }
4747
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
4848
= 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>
4949

50-
warning: non-local `impl` definition, they should be avoided as they go against expectation
50+
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
5151
--> $DIR/exhaustive-trait.rs:28:5
5252
|
5353
LL | / impl PartialEq<&Dog> for () {
@@ -63,7 +63,7 @@ LL | | }
6363
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
6464
= 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>
6565

66-
warning: non-local `impl` definition, they should be avoided as they go against expectation
66+
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
6767
--> $DIR/exhaustive-trait.rs:35:5
6868
|
6969
LL | / impl PartialEq<Dog> for &Dog {
@@ -79,7 +79,7 @@ LL | | }
7979
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
8080
= 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>
8181

82-
warning: non-local `impl` definition, they should be avoided as they go against expectation
82+
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
8383
--> $DIR/exhaustive-trait.rs:42:5
8484
|
8585
LL | / impl PartialEq<&Dog> for &Dog {

0 commit comments

Comments
 (0)