File: consts.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (134 lines) | stat: -rw-r--r-- 6,776 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
  --> $DIR/consts.rs:13:5
   |
LL | const Z: () = {
   | -----------
   | |     |
   | |     help: use a const-anon item to suppress this lint: `_`
   | move the `impl` block outside of this constant `Z`
...
LL |     impl Uto for &Test {}
   |     ^^^^^---^^^^^^----
   |          |        |
   |          |        `Test` is not local
   |          `Uto` is not local
   |
   = 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`
   = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint
   = note: `#[warn(non_local_definitions)]` on by default

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
  --> $DIR/consts.rs:24:5
   |
LL | static A: u32 = {
   | ------------- move the `impl` block outside of this static `A`
LL |     impl Uto2 for Test {}
   |     ^^^^^----^^^^^----
   |          |        |
   |          |        `Test` is not local
   |          `Uto2` is not local
   |
   = 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`
   = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
  --> $DIR/consts.rs:32:5
   |
LL | const B: u32 = {
   | ------------ move the `impl` block outside of this constant `B`
LL |     impl Uto3 for Test {}
   |     ^^^^^----^^^^^----
   |          |        |
   |          |        `Test` is not local
   |          `Uto3` is not local
   |
   = 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`
   = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
  --> $DIR/consts.rs:43:5
   |
LL | fn main() {
   | --------- move the `impl` block outside of this function `main`
LL |     impl Test {
   |     ^^^^^----
   |          |
   |          `Test` is not local
   |
   = 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`

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
  --> $DIR/consts.rs:50:9
   |
LL |       const {
   |  ___________-
LL | |         impl Test {
   | |         ^^^^^----
   | |              |
   | |              `Test` is not local
LL | |
LL | |             fn hoo() {}
...  |
LL | |         1
LL | |     };
   | |_____- move the `impl` block outside of this inline constant `<unnameable>` and up 2 bodies
   |
   = 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`

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
  --> $DIR/consts.rs:59:9
   |
LL |     const _: u32 = {
   |     ------------ move the `impl` block outside of this constant `_` and up 2 bodies
LL |         impl Test {
   |         ^^^^^----
   |              |
   |              `Test` is not local
   |
   = 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`
   = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
  --> $DIR/consts.rs:69:13
   |
LL |         const _: () = {
   |         ----------- move the `impl` block outside of this constant `_` and up 3 bodies
LL |             impl Test {}
   |             ^^^^^----
   |                  |
   |                  `Test` is not local
   |
   = 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`
   = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
  --> $DIR/consts.rs:79:9
   |
LL |     let _a = || {
   |              -- move the `impl` block outside of this closure `<unnameable>` and up 2 bodies
LL |         impl Uto9 for Test {}
   |         ^^^^^----^^^^^----
   |              |        |
   |              |        `Test` is not local
   |              `Uto9` is not local
   |
   = 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`

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
  --> $DIR/consts.rs:86:9
   |
LL |       type A = [u32; {
   |  ____________________-
LL | |         impl Uto10 for Test {}
   | |         ^^^^^-----^^^^^----
   | |              |         |
   | |              |         `Test` is not local
   | |              `Uto10` is not local
...  |
LL | |     }];
   | |_____- move the `impl` block outside of this constant expression `<unnameable>` and up 2 bodies
   |
   = 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`

warning: 9 warnings emitted