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
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`
Copy file name to clipboardExpand all lines: tests/ui/lint/non-local-defs/consts.stderr
+29-8
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,10 @@ LL | const Z: () = {
5
5
| - help: use a const-anon item to suppress this lint: `_`
6
6
...
7
7
LL | impl Uto for &Test {}
8
-
| ^^^^^^^^^^^^^^^^^^
8
+
| ^^^^^---^^^^^-----
9
+
| | |
10
+
| | `&'_ Test` is not local
11
+
| `Uto` is not local
9
12
|
10
13
= 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
14
= 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`
@@ -22,7 +25,10 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
22
25
--> $DIR/consts.rs:24:5
23
26
|
24
27
LL | impl Uto2 for Test {}
25
-
| ^^^^^^^^^^^^^^^^^^
28
+
| ^^^^^----^^^^^----
29
+
| | |
30
+
| | `Test` is not local
31
+
| `Uto2` is not local
26
32
|
27
33
= 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
34
= 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`
@@ -38,7 +44,10 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
38
44
--> $DIR/consts.rs:32:5
39
45
|
40
46
LL | impl Uto3 for Test {}
41
-
| ^^^^^^^^^^^^^^^^^^
47
+
| ^^^^^----^^^^^----
48
+
| | |
49
+
| | `Test` is not local
50
+
| `Uto3` is not local
42
51
|
43
52
= 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
53
= 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`
@@ -54,7 +63,9 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
54
63
--> $DIR/consts.rs:43:5
55
64
|
56
65
LL | impl Test {
57
-
| ^^^^^^^^^
66
+
| ^^^^^----
67
+
| |
68
+
| `Test` is not local
58
69
|
59
70
= note: methods and associated constants are still usable outside the current expression, only `impl Local` and `impl dyn Local` can ever be private, and only if the type is nested in the same item as the `impl`
60
71
help: move this `impl` block outside of the current function `main`
@@ -71,7 +82,9 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
71
82
--> $DIR/consts.rs:50:9
72
83
|
73
84
LL | impl Test {
74
-
| ^^^^^^^^^
85
+
| ^^^^^----
86
+
| |
87
+
| `Test` is not local
75
88
|
76
89
= note: methods and associated constants are still usable outside the current expression, only `impl Local` and `impl dyn Local` can ever be private, and only if the type is nested in the same item as the `impl`
77
90
help: move this `impl` block outside of the current inline constant `<unnameable>` and up 2 bodies
@@ -88,7 +101,9 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
88
101
--> $DIR/consts.rs:59:9
89
102
|
90
103
LL | impl Test {
91
-
| ^^^^^^^^^
104
+
| ^^^^^----
105
+
| |
106
+
| `Test` is not local
92
107
|
93
108
= note: methods and associated constants are still usable outside the current expression, only `impl Local` and `impl dyn Local` can ever be private, and only if the type is nested in the same item as the `impl`
94
109
help: move this `impl` block outside of the current constant `_` and up 2 bodies
@@ -106,7 +121,10 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
106
121
--> $DIR/consts.rs:72:9
107
122
|
108
123
LL | impl Uto9 for Test {}
109
-
| ^^^^^^^^^^^^^^^^^^
124
+
| ^^^^^----^^^^^----
125
+
| | |
126
+
| | `Test` is not local
127
+
| `Uto9` is not local
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`
@@ -121,7 +139,10 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
121
139
--> $DIR/consts.rs:79:9
122
140
|
123
141
LL | impl Uto10 for Test {}
124
-
| ^^^^^^^^^^^^^^^^^^^
142
+
| ^^^^^-----^^^^^----
143
+
| | |
144
+
| | `Test` is not local
145
+
| `Uto10` is not local
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`
Copy file name to clipboardExpand all lines: tests/ui/lint/non-local-defs/exhaustive-trait.stderr
+24-6
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,10 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
2
2
--> $DIR/exhaustive-trait.rs:7:5
3
3
|
4
4
LL | impl PartialEq<()> for Dog {
5
-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
5
+
| ^^^^^---------^^^^^^^^^---
6
+
| | |
7
+
| | `Dog` is not local
8
+
| `PartialEq` is not local
6
9
|
7
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
8
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`
@@ -23,7 +26,10 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
23
26
--> $DIR/exhaustive-trait.rs:14:5
24
27
|
25
28
LL | impl PartialEq<()> for &Dog {
26
-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
29
+
| ^^^^^---------^^^^^^^^^----
30
+
| | |
31
+
| | `&'_ Dog` is not local
32
+
| `PartialEq` is not local
27
33
|
28
34
= 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
35
= 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`
@@ -43,7 +49,10 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
43
49
--> $DIR/exhaustive-trait.rs:21:5
44
50
|
45
51
LL | impl PartialEq<Dog> for () {
46
-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
52
+
| ^^^^^---------^^^^^^^^^^--
53
+
| | |
54
+
| | `()` is not local
55
+
| `PartialEq` is not local
47
56
|
48
57
= 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
58
= 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`
@@ -63,7 +72,10 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
63
72
--> $DIR/exhaustive-trait.rs:28:5
64
73
|
65
74
LL | impl PartialEq<&Dog> for () {
66
-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
75
+
| ^^^^^---------^^^^^^^^^^^--
76
+
| | |
77
+
| | `()` is not local
78
+
| `PartialEq` is not local
67
79
|
68
80
= 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`
@@ -83,7 +95,10 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
83
95
--> $DIR/exhaustive-trait.rs:35:5
84
96
|
85
97
LL | impl PartialEq<Dog> for &Dog {
86
-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
98
+
| ^^^^^---------^^^^^^^^^^----
99
+
| | |
100
+
| | `&'_ Dog` is not local
101
+
| `PartialEq` is not local
87
102
|
88
103
= 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
104
= 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`
@@ -103,7 +118,10 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
103
118
--> $DIR/exhaustive-trait.rs:42:5
104
119
|
105
120
LL | impl PartialEq<&Dog> for &Dog {
106
-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
121
+
| ^^^^^---------^^^^^^^^^^^----
122
+
| | |
123
+
| | `&'_ Dog` is not local
124
+
| `PartialEq` is not local
107
125
|
108
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
109
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`
0 commit comments