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