You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
= note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`
15
15
= note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint
16
16
= 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>
17
-
note: the lint level is defined here
18
-
--> $DIR/cargo-update.rs:13:9
19
-
|
20
-
LL | #![warn(non_local_definitions)]
21
-
| ^^^^^^^^^^^^^^^^^^^^^
17
+
= note: `#[warn(non_local_definitions)]` on by default
22
18
= note: this warning originates in the macro `non_local_macro::non_local_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
Copy file name to clipboardExpand all lines: tests/ui/lint/non-local-defs/consts.stderr
+9-13
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
2
-
--> $DIR/consts.rs:15:5
2
+
--> $DIR/consts.rs:13:5
3
3
|
4
4
LL | const Z: () = {
5
5
| -----------
@@ -17,14 +17,10 @@ LL | impl Uto for &Test {}
17
17
= note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`
18
18
= note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint
19
19
= 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>
20
-
note: the lint level is defined here
21
-
--> $DIR/consts.rs:5:9
22
-
|
23
-
LL | #![warn(non_local_definitions)]
24
-
| ^^^^^^^^^^^^^^^^^^^^^
20
+
= note: `#[warn(non_local_definitions)]` on by default
25
21
26
22
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
27
-
--> $DIR/consts.rs:26:5
23
+
--> $DIR/consts.rs:24:5
28
24
|
29
25
LL | static A: u32 = {
30
26
| ------------- move the `impl` block outside of this static `A`
@@ -40,7 +36,7 @@ LL | impl Uto2 for Test {}
40
36
= 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>
41
37
42
38
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
43
-
--> $DIR/consts.rs:34:5
39
+
--> $DIR/consts.rs:32:5
44
40
|
45
41
LL | const B: u32 = {
46
42
| ------------ move the `impl` block outside of this constant `B`
@@ -56,7 +52,7 @@ LL | impl Uto3 for Test {}
56
52
= 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>
57
53
58
54
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
59
-
--> $DIR/consts.rs:45:5
55
+
--> $DIR/consts.rs:43:5
60
56
|
61
57
LL | fn main() {
62
58
| --------- move the `impl` block outside of this function `main`
@@ -69,7 +65,7 @@ LL | impl Test {
69
65
= 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>
70
66
71
67
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
72
-
--> $DIR/consts.rs:52:9
68
+
--> $DIR/consts.rs:50:9
73
69
|
74
70
LL | const {
75
71
| ___________-
@@ -88,7 +84,7 @@ LL | | };
88
84
= 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>
89
85
90
86
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
91
-
--> $DIR/consts.rs:61:9
87
+
--> $DIR/consts.rs:59:9
92
88
|
93
89
LL | const _: u32 = {
94
90
| ------------ move the `impl` block outside of this constant `_` and up 2 bodies
@@ -102,7 +98,7 @@ LL | impl Test {
102
98
= 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>
103
99
104
100
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
105
-
--> $DIR/consts.rs:74:9
101
+
--> $DIR/consts.rs:72:9
106
102
|
107
103
LL | let _a = || {
108
104
| -- move the `impl` block outside of this closure `<unnameable>` and up 2 bodies
@@ -117,7 +113,7 @@ LL | impl Uto9 for Test {}
117
113
= 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>
118
114
119
115
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
Copy file name to clipboardExpand all lines: tests/ui/lint/non-local-defs/exhaustive-trait.stderr
+7-11
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
2
-
--> $DIR/exhaustive-trait.rs:9:5
2
+
--> $DIR/exhaustive-trait.rs:7:5
3
3
|
4
4
LL | fn main() {
5
5
| --------- move the `impl` block outside of this function `main`
@@ -12,14 +12,10 @@ LL | impl PartialEq<()> for Dog {
12
12
= note: `impl` may be usable in bounds, etc. from outside the expression, which might e.g. make something constructible that previously wasn't, because it's still on a publicly-visible type
13
13
= note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`
14
14
= 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>
15
-
note: the lint level is defined here
16
-
--> $DIR/exhaustive-trait.rs:4:9
17
-
|
18
-
LL | #![warn(non_local_definitions)]
19
-
| ^^^^^^^^^^^^^^^^^^^^^
15
+
= note: `#[warn(non_local_definitions)]` on by default
20
16
21
17
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
22
-
--> $DIR/exhaustive-trait.rs:16:5
18
+
--> $DIR/exhaustive-trait.rs:14:5
23
19
|
24
20
LL | fn main() {
25
21
| --------- move the `impl` block outside of this function `main`
0 commit comments