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
Copy file name to clipboardExpand all lines: tests/ui/lint/non-local-defs/consts.stderr
+32-3
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,36 @@ LL | impl Test {
95
95
= 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>
96
96
97
97
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
98
-
--> $DIR/consts.rs:72:9
98
+
--> $DIR/consts.rs:69:13
99
+
|
100
+
LL | const _: () = {
101
+
| ----------- move the `impl` block outside of this constant `_` and up 3 bodies
102
+
LL | impl Test {}
103
+
| ^^^^^----
104
+
| |
105
+
| `Test` is not local
106
+
|
107
+
= 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`
108
+
= 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
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>
110
+
111
+
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
112
+
--> $DIR/consts.rs:80:13
113
+
|
114
+
LL | const _: () = {
115
+
| ----------- move the `impl` block outside of this constant `_` and up 3 bodies
116
+
...
117
+
LL | impl tmp::InnerTest {}
118
+
| ^^^^^--------------
119
+
| |
120
+
| `InnerTest` is not local
121
+
|
122
+
= 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`
123
+
= 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
124
+
= 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>
125
+
126
+
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
127
+
--> $DIR/consts.rs:93:9
99
128
|
100
129
LL | let _a = || {
101
130
| -- move the `impl` block outside of this closure `<unnameable>` and up 2 bodies
@@ -109,7 +138,7 @@ LL | impl Uto9 for Test {}
109
138
= 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>
110
139
111
140
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
112
-
--> $DIR/consts.rs:79:9
141
+
--> $DIR/consts.rs:100:9
113
142
|
114
143
LL | type A = [u32; {
115
144
| ____________________-
@@ -126,5 +155,5 @@ LL | | }];
126
155
= 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`
127
156
= 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>
0 commit comments