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: `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
8
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 and all the necessary types/traits outside the of the current constant `_IMPL_DEBUG`
9
+
help: move this `impl` block and outside the 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`
15
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
16
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
+40-16
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,14 @@ LL | impl Uto for &Test {}
9
9
|
10
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
11
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 and all the necessary types/traits outside the of the current constant `Z`
12
+
help: move this `impl` block and outside the of the current constant `Z`
13
13
--> $DIR/consts.rs:13:5
14
14
|
15
15
LL | impl Uto for &Test {}
16
-
| ^^^^^^^^^^^^^^^^^^^^^
16
+
| ^^^^^---^^^^^-----^^^
17
+
| | |
18
+
| | may need to be moved as well
19
+
| may need to be moved as well
17
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
18
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>
19
22
= note: `#[warn(non_local_definitions)]` on by default
@@ -26,11 +29,14 @@ LL | impl Uto2 for Test {}
26
29
|
27
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
28
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`
29
-
help: move this `impl` block and all the necessary types/traits outside the of the current static `A`
32
+
help: move this `impl` block and outside the of the current static `A`
30
33
--> $DIR/consts.rs:24:5
31
34
|
32
35
LL | impl Uto2 for Test {}
33
-
| ^^^^^^^^^^^^^^^^^^^^^
36
+
| ^^^^^----^^^^^----^^^
37
+
| | |
38
+
| | may need to be moved as well
39
+
| may need to be moved as well
34
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
35
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>
36
42
@@ -42,11 +48,14 @@ LL | impl Uto3 for Test {}
42
48
|
43
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
44
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`
45
-
help: move this `impl` block and all the necessary types/traits outside the of the current constant `B`
51
+
help: move this `impl` block and outside the of the current constant `B`
46
52
--> $DIR/consts.rs:32:5
47
53
|
48
54
LL | impl Uto3 for Test {}
49
-
| ^^^^^^^^^^^^^^^^^^^^^
55
+
| ^^^^^----^^^^^----^^^
56
+
| | |
57
+
| | may need to be moved as well
58
+
| may need to be moved as well
50
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
51
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>
52
61
@@ -57,10 +66,13 @@ LL | impl Test {
57
66
| ^^^^^^^^^
58
67
|
59
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
60
-
help: move this `impl` block and all the necessary types/traits outside the of the current function `main`
69
+
help: move this `impl` block and outside the of the current function `main`
61
70
--> $DIR/consts.rs:43:5
62
71
|
63
-
LL | / impl Test {
72
+
LL | impl Test {
73
+
| ^ ---- may need to be moved as well
74
+
| _____|
75
+
| |
64
76
LL | |
65
77
LL | | fn foo() {}
66
78
LL | | }
@@ -74,10 +86,13 @@ LL | impl Test {
74
86
| ^^^^^^^^^
75
87
|
76
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
77
-
help: move this `impl` block and all the necessary types/traits outside the of the current inline constant `<unnameable>` and up 2 bodies
89
+
help: move this `impl` block and outside the of the current inline constant `<unnameable>` and up 2 bodies
78
90
--> $DIR/consts.rs:50:9
79
91
|
80
-
LL | / impl Test {
92
+
LL | impl Test {
93
+
| ^ ---- may need to be moved as well
94
+
| _________|
95
+
| |
81
96
LL | |
82
97
LL | | fn hoo() {}
83
98
LL | | }
@@ -91,10 +106,13 @@ LL | impl Test {
91
106
| ^^^^^^^^^
92
107
|
93
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
94
-
help: move this `impl` block and all the necessary types/traits outside the of the current constant `_` and up 2 bodies
109
+
help: move this `impl` block and outside the of the current constant `_` and up 2 bodies
95
110
--> $DIR/consts.rs:59:9
96
111
|
97
-
LL | / impl Test {
112
+
LL | impl Test {
113
+
| ^ ---- may need to be moved as well
114
+
| _________|
115
+
| |
98
116
LL | |
99
117
LL | | fn foo2() {}
100
118
LL | | }
@@ -110,11 +128,14 @@ LL | impl Uto9 for Test {}
110
128
|
111
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
112
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`
113
-
help: move this `impl` block and all the necessary types/traits outside the of the current closure `<unnameable>` and up 2 bodies
131
+
help: move this `impl` block and outside the of the current closure `<unnameable>` and up 2 bodies
114
132
--> $DIR/consts.rs:72:9
115
133
|
116
134
LL | impl Uto9 for Test {}
117
-
| ^^^^^^^^^^^^^^^^^^^^^
135
+
| ^^^^^----^^^^^----^^^
136
+
| | |
137
+
| | may need to be moved as well
138
+
| may need to be moved as well
118
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>
119
140
120
141
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
@@ -125,11 +146,14 @@ LL | impl Uto10 for Test {}
125
146
|
126
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
127
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`
128
-
help: move this `impl` block and all the necessary types/traits outside the of the current constant expression `<unnameable>` and up 2 bodies
149
+
help: move this `impl` block and outside the of the current constant expression `<unnameable>` and up 2 bodies
129
150
--> $DIR/consts.rs:79:9
130
151
|
131
152
LL | impl Uto10 for Test {}
132
-
| ^^^^^^^^^^^^^^^^^^^^^^
153
+
| ^^^^^-----^^^^^----^^^
154
+
| | |
155
+
| | may need to be moved as well
156
+
| may need to be moved as well
133
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>
Copy file name to clipboardExpand all lines: tests/ui/lint/non-local-defs/exhaustive-trait.stderr
+36-12
Original file line number
Diff line number
Diff line change
@@ -6,10 +6,14 @@ LL | impl PartialEq<()> for Dog {
6
6
|
7
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
8
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 and all the necessary types/traits outside the of the current function `main`
9
+
help: move this `impl` block and outside the of the current function `main`
10
10
--> $DIR/exhaustive-trait.rs:7:5
11
11
|
12
-
LL | / impl PartialEq<()> for Dog {
12
+
LL | impl PartialEq<()> for Dog {
13
+
| ^ ------------- --- may need to be moved as well
= 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
29
33
= 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`
30
-
help: move this `impl` block and all the necessary types/traits outside the of the current function `main`
34
+
help: move this `impl` block and outside the of the current function `main`
31
35
--> $DIR/exhaustive-trait.rs:14:5
32
36
|
33
-
LL | / impl PartialEq<()> for &Dog {
37
+
LL | impl PartialEq<()> for &Dog {
38
+
| ^ ------------- ---- may need to be moved as well
= 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
49
57
= 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`
50
-
help: move this `impl` block and all the necessary types/traits outside the of the current function `main`
58
+
help: move this `impl` block and outside the of the current function `main`
51
59
--> $DIR/exhaustive-trait.rs:21:5
52
60
|
53
-
LL | / impl PartialEq<Dog> for () {
61
+
LL | impl PartialEq<Dog> for () {
62
+
| ^ -------------- -- may need to be moved as well
= 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
69
81
= 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`
70
-
help: move this `impl` block and all the necessary types/traits outside the of the current function `main`
82
+
help: move this `impl` block and outside the of the current function `main`
71
83
--> $DIR/exhaustive-trait.rs:28:5
72
84
|
73
-
LL | / impl PartialEq<&Dog> for () {
85
+
LL | impl PartialEq<&Dog> for () {
86
+
| ^ --------------- -- may need to be moved as well
= 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
89
105
= 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`
90
-
help: move this `impl` block and all the necessary types/traits outside the of the current function `main`
106
+
help: move this `impl` block and outside the of the current function `main`
91
107
--> $DIR/exhaustive-trait.rs:35:5
92
108
|
93
-
LL | / impl PartialEq<Dog> for &Dog {
109
+
LL | impl PartialEq<Dog> for &Dog {
110
+
| ^ -------------- ---- may need to be moved as well
= 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
109
129
= 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`
110
-
help: move this `impl` block and all the necessary types/traits outside the of the current function `main`
130
+
help: move this `impl` block and outside the of the current function `main`
111
131
--> $DIR/exhaustive-trait.rs:42:5
112
132
|
113
-
LL | / impl PartialEq<&Dog> for &Dog {
133
+
LL | impl PartialEq<&Dog> for &Dog {
134
+
| ^ --------------- ---- may need to be moved as well
0 commit comments