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