fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
5.8 KiB178 linesraw
1error[E0658]: `loop` is not allowed in a `const`
2  --> $DIR/loop.rs:10:15
3   |
4LL | const _: () = loop {};
5   |               ^^^^^^^
6   |
7   = note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information
8   = help: add `#![feature(const_loop)]` to the crate attributes to enable
9
10error[E0658]: `loop` is not allowed in a `static`
11  --> $DIR/loop.rs:12:19
12   |
13LL | static FOO: i32 = loop { break 4; };
14   |                   ^^^^^^^^^^^^^^^^^
15   |
16   = note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information
17   = help: add `#![feature(const_loop)]` to the crate attributes to enable
18
19error[E0658]: `loop` is not allowed in a `const fn`
20  --> $DIR/loop.rs:15:5
21   |
22LL |     loop {}
23   |     ^^^^^^^
24   |
25   = note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information
26   = help: add `#![feature(const_loop)]` to the crate attributes to enable
27
28error[E0658]: `loop` is not allowed in a `const fn`
29  --> $DIR/loop.rs:28:9
30   |
31LL |         loop {}
32   |         ^^^^^^^
33   |
34   = note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information
35   = help: add `#![feature(const_loop)]` to the crate attributes to enable
36
37error[E0658]: `while` is not allowed in a `const`
38  --> $DIR/loop.rs:40:9
39   |
40LL |         while false {}
41   |         ^^^^^^^^^^^^^^
42   |
43   = note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information
44   = help: add `#![feature(const_loop)]` to the crate attributes to enable
45   = help: add `#![feature(const_if_match)]` to the crate attributes to enable
46
47error[E0658]: `while` is not allowed in a `const`
48  --> $DIR/loop.rs:49:5
49   |
50LL | /     while x < 4 {
51LL | |         x += 1;
52LL | |     }
53   | |_____^
54   |
55   = note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information
56   = help: add `#![feature(const_loop)]` to the crate attributes to enable
57   = help: add `#![feature(const_if_match)]` to the crate attributes to enable
58
59error[E0658]: `while` is not allowed in a `const`
60  --> $DIR/loop.rs:53:5
61   |
62LL | /     while x < 8 {
63LL | |         x += 1;
64LL | |     }
65   | |_____^
66   |
67   = note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information
68   = help: add `#![feature(const_loop)]` to the crate attributes to enable
69   = help: add `#![feature(const_if_match)]` to the crate attributes to enable
70
71error[E0744]: `for` is not allowed in a `const`
72  --> $DIR/loop.rs:63:5
73   |
74LL | /     for i in 0..4 {
75LL | |         x += i;
76LL | |     }
77   | |_____^
78
79error[E0744]: `for` is not allowed in a `const`
80  --> $DIR/loop.rs:67:5
81   |
82LL | /     for i in 0..4 {
83LL | |         x += i;
84LL | |     }
85   | |_____^
86
87error[E0658]: `loop` is not allowed in a `const`
88  --> $DIR/loop.rs:77:5
89   |
90LL | /     loop {
91LL | |         x += 1;
92LL | |         if x == 4 {
93LL | |             break;
94LL | |         }
95LL | |     }
96   | |_____^
97   |
98   = note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information
99   = help: add `#![feature(const_loop)]` to the crate attributes to enable
100
101error[E0658]: `if` is not allowed in a `const`
102  --> $DIR/loop.rs:79:9
103   |
104LL | /         if x == 4 {
105LL | |             break;
106LL | |         }
107   | |_________^
108   |
109   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
110   = help: add `#![feature(const_if_match)]` to the crate attributes to enable
111
112error[E0658]: `loop` is not allowed in a `const`
113  --> $DIR/loop.rs:84:5
114   |
115LL | /     loop {
116LL | |         x += 1;
117LL | |         if x == 8 {
118LL | |             break;
119LL | |         }
120LL | |     }
121   | |_____^
122   |
123   = note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information
124   = help: add `#![feature(const_loop)]` to the crate attributes to enable
125
126error[E0658]: `if` is not allowed in a `const`
127  --> $DIR/loop.rs:86:9
128   |
129LL | /         if x == 8 {
130LL | |             break;
131LL | |         }
132   | |_________^
133   |
134   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
135   = help: add `#![feature(const_if_match)]` to the crate attributes to enable
136
137error[E0658]: `while` is not allowed in a `const`
138  --> $DIR/loop.rs:96:5
139   |
140LL |     while let None = Some(x) { }
141   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
142   |
143   = note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information
144   = help: add `#![feature(const_loop)]` to the crate attributes to enable
145   = help: add `#![feature(const_if_match)]` to the crate attributes to enable
146
147error[E0658]: `while` is not allowed in a `const`
148  --> $DIR/loop.rs:97:5
149   |
150LL |     while let None = Some(x) { }
151   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152   |
153   = note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information
154   = help: add `#![feature(const_loop)]` to the crate attributes to enable
155   = help: add `#![feature(const_if_match)]` to the crate attributes to enable
156
157error[E0658]: `loop` is not allowed in a `const`
158  --> $DIR/loop.rs:19:22
159   |
160LL |     const BAR: i32 = loop { break 4; };
161   |                      ^^^^^^^^^^^^^^^^^
162   |
163   = note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information
164   = help: add `#![feature(const_loop)]` to the crate attributes to enable
165
166error[E0658]: `loop` is not allowed in a `const`
167  --> $DIR/loop.rs:23:22
168   |
169LL |     const BAR: i32 = loop { break 4; };
170   |                      ^^^^^^^^^^^^^^^^^
171   |
172   = note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information
173   = help: add `#![feature(const_loop)]` to the crate attributes to enable
174
175error: aborting due to 17 previous errors
176
177Some errors have detailed explanations: E0658, E0744.
178For more information about an error, try `rustc --explain E0658`.