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
= help: move this `impl` block outside the of the current constant `_IMPL_DEBUG`
8
7
= 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
9
8
= 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`
9
+
help: move this `impl` block outside of the current constant `_IMPL_DEBUG`
= note: the macro `non_local_macro::non_local_impl` may come from an old version of the `non_local_macro` crate, try updating your dependency with `cargo update -p non_local_macro`
11
18
= note: anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type are consider to be transparent regarding the nesting level
12
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>
Copy file name to clipboardExpand all lines: tests/ui/lint/non-local-defs/consts.stderr
+73-8Lines changed: 73 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,16 @@ LL | const Z: () = {
7
7
LL | impl Uto for &Test {}
8
8
| ^^^^^^^^^^^^^^^^^^
9
9
|
10
-
= help: move this `impl` block outside the of the current constant `Z`
11
10
= 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
12
11
= 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`
12
+
help: move this `impl` block outside of the current constant `Z`
13
+
--> $DIR/consts.rs:13:5
14
+
|
15
+
LL | impl Uto for &Test {}
16
+
| ^^^^^---^^^^^-----^^^
17
+
| | |
18
+
| | may need to be moved as well
19
+
| may need to be moved as well
13
20
= note: anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type are consider to be transparent regarding the nesting level
14
21
= 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
22
= note: `#[warn(non_local_definitions)]` on by default
@@ -20,9 +27,16 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
20
27
LL | impl Uto2 for Test {}
21
28
| ^^^^^^^^^^^^^^^^^^
22
29
|
23
-
= help: move this `impl` block outside the of the current static `A`
24
30
= 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
25
31
= 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`
32
+
help: move this `impl` block outside of the current static `A`
33
+
--> $DIR/consts.rs:24:5
34
+
|
35
+
LL | impl Uto2 for Test {}
36
+
| ^^^^^----^^^^^----^^^
37
+
| | |
38
+
| | may need to be moved as well
39
+
| may need to be moved as well
26
40
= note: anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type are consider to be transparent regarding the nesting level
27
41
= 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>
28
42
@@ -32,9 +46,16 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
32
46
LL | impl Uto3 for Test {}
33
47
| ^^^^^^^^^^^^^^^^^^
34
48
|
35
-
= help: move this `impl` block outside the of the current constant `B`
36
49
= 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
37
50
= 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`
51
+
help: move this `impl` block outside of the current constant `B`
52
+
--> $DIR/consts.rs:32:5
53
+
|
54
+
LL | impl Uto3 for Test {}
55
+
| ^^^^^----^^^^^----^^^
56
+
| | |
57
+
| | may need to be moved as well
58
+
| may need to be moved as well
38
59
= note: anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type are consider to be transparent regarding the nesting level
39
60
= 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>
40
61
@@ -44,8 +65,18 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
44
65
LL | impl Test {
45
66
| ^^^^^^^^^
46
67
|
47
-
= help: move this `impl` block outside the of the current function `main`
48
68
= note: methods and assoc const are still usable outside the current expression, only `impl Local` and `impl dyn Local` are local and only if the `Local` type is at the same nesting as the `impl` block
69
+
help: move this `impl` block outside of the current function `main`
70
+
--> $DIR/consts.rs:43:5
71
+
|
72
+
LL | impl Test {
73
+
| ^ ---- may need to be moved as well
74
+
| _____|
75
+
| |
76
+
LL | |
77
+
LL | | fn foo() {}
78
+
LL | | }
79
+
| |_____^
49
80
= 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>
50
81
51
82
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
@@ -54,8 +85,18 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
54
85
LL | impl Test {
55
86
| ^^^^^^^^^
56
87
|
57
-
= help: move this `impl` block outside the of the current inline constant `<unnameable>` and up 2 bodies
58
88
= note: methods and assoc const are still usable outside the current expression, only `impl Local` and `impl dyn Local` are local and only if the `Local` type is at the same nesting as the `impl` block
89
+
help: move this `impl` block outside of the current inline constant `<unnameable>` and up 2 bodies
90
+
--> $DIR/consts.rs:50:9
91
+
|
92
+
LL | impl Test {
93
+
| ^ ---- may need to be moved as well
94
+
| _________|
95
+
| |
96
+
LL | |
97
+
LL | | fn hoo() {}
98
+
LL | | }
99
+
| |_________^
59
100
= 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>
60
101
61
102
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
@@ -64,8 +105,18 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
64
105
LL | impl Test {
65
106
| ^^^^^^^^^
66
107
|
67
-
= help: move this `impl` block outside the of the current constant `_` and up 2 bodies
68
108
= note: methods and assoc const are still usable outside the current expression, only `impl Local` and `impl dyn Local` are local and only if the `Local` type is at the same nesting as the `impl` block
109
+
help: move this `impl` block outside of the current constant `_` and up 2 bodies
110
+
--> $DIR/consts.rs:59:9
111
+
|
112
+
LL | impl Test {
113
+
| ^ ---- may need to be moved as well
114
+
| _________|
115
+
| |
116
+
LL | |
117
+
LL | | fn foo2() {}
118
+
LL | | }
119
+
| |_________^
69
120
= note: anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type are consider to be transparent regarding the nesting level
70
121
= 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>
71
122
@@ -75,9 +126,16 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
75
126
LL | impl Uto9 for Test {}
76
127
| ^^^^^^^^^^^^^^^^^^
77
128
|
78
-
= help: move this `impl` block outside the of the current closure `<unnameable>` and up 2 bodies
79
129
= 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
80
130
= 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`
131
+
help: move this `impl` block outside of the current closure `<unnameable>` and up 2 bodies
132
+
--> $DIR/consts.rs:72:9
133
+
|
134
+
LL | impl Uto9 for Test {}
135
+
| ^^^^^----^^^^^----^^^
136
+
| | |
137
+
| | may need to be moved as well
138
+
| may need to be moved as well
81
139
= 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>
82
140
83
141
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
@@ -86,9 +144,16 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
86
144
LL | impl Uto10 for Test {}
87
145
| ^^^^^^^^^^^^^^^^^^^
88
146
|
89
-
= help: move this `impl` block outside the of the current constant expression `<unnameable>` and up 2 bodies
90
147
= 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
91
148
= 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`
149
+
help: move this `impl` block outside of the current constant expression `<unnameable>` and up 2 bodies
150
+
--> $DIR/consts.rs:79:9
151
+
|
152
+
LL | impl Uto10 for Test {}
153
+
| ^^^^^-----^^^^^----^^^
154
+
| | |
155
+
| | may need to be moved as well
156
+
| may need to be moved as well
92
157
= 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