@@ -76,60 +76,24 @@ LL | const fn foo11_2<T: Send>(t: T) -> T { t }
76
76
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
77
77
= help: add `#![feature(const_fn)]` to the crate attributes to enable
78
78
79
- error[E0658]: floating point arithmetic is not allowed in constant functions
80
- --> $DIR/min_const_fn.rs:80:33
81
- |
82
- LL | const fn foo19(f: f32) -> f32 { f * 2.0 }
83
- | ^^^^^^^
84
- |
85
- = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
86
- = help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable
87
-
88
- error[E0658]: floating point arithmetic is not allowed in constant functions
89
- --> $DIR/min_const_fn.rs:82:35
90
- |
91
- LL | const fn foo19_2(f: f32) -> f32 { 2.0 - f }
92
- | ^^^^^^^
93
- |
94
- = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
95
- = help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable
96
-
97
- error[E0658]: floating point arithmetic is not allowed in constant functions
98
- --> $DIR/min_const_fn.rs:84:35
99
- |
100
- LL | const fn foo19_3(f: f32) -> f32 { -f }
101
- | ^^
102
- |
103
- = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
104
- = help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable
105
-
106
- error[E0658]: floating point arithmetic is not allowed in constant functions
107
- --> $DIR/min_const_fn.rs:86:43
108
- |
109
- LL | const fn foo19_4(f: f32, g: f32) -> f32 { f / g }
110
- | ^^^^^
111
- |
112
- = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
113
- = help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable
114
-
115
79
error[E0013]: constant functions cannot refer to statics
116
- --> $DIR/min_const_fn.rs:90 :27
80
+ --> $DIR/min_const_fn.rs:82 :27
117
81
|
118
82
LL | const fn foo25() -> u32 { BAR }
119
83
| ^^^
120
84
|
121
85
= help: consider extracting the value of the `static` to a `const`, and referring to that
122
86
123
87
error[E0013]: constant functions cannot refer to statics
124
- --> $DIR/min_const_fn.rs:91 :37
88
+ --> $DIR/min_const_fn.rs:83 :37
125
89
|
126
90
LL | const fn foo26() -> &'static u32 { &BAR }
127
91
| ^^^
128
92
|
129
93
= help: consider extracting the value of the `static` to a `const`, and referring to that
130
94
131
95
error[E0658]: casting pointers to integers in constant functions is unstable
132
- --> $DIR/min_const_fn.rs:92 :42
96
+ --> $DIR/min_const_fn.rs:84 :42
133
97
|
134
98
LL | const fn foo30(x: *const u32) -> usize { x as usize }
135
99
| ^^^^^^^^^^
@@ -138,7 +102,7 @@ LL | const fn foo30(x: *const u32) -> usize { x as usize }
138
102
= help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable
139
103
140
104
error[E0658]: casting pointers to integers in constant functions is unstable
141
- --> $DIR/min_const_fn.rs:94 :63
105
+ --> $DIR/min_const_fn.rs:86 :63
142
106
|
143
107
LL | const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } }
144
108
| ^^^^^^^^^^
@@ -147,7 +111,7 @@ LL | const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize }
147
111
= help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable
148
112
149
113
error[E0658]: casting pointers to integers in constant functions is unstable
150
- --> $DIR/min_const_fn.rs:96 :42
114
+ --> $DIR/min_const_fn.rs:88 :42
151
115
|
152
116
LL | const fn foo30_2(x: *mut u32) -> usize { x as usize }
153
117
| ^^^^^^^^^^
@@ -156,7 +120,7 @@ LL | const fn foo30_2(x: *mut u32) -> usize { x as usize }
156
120
= help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable
157
121
158
122
error[E0658]: casting pointers to integers in constant functions is unstable
159
- --> $DIR/min_const_fn.rs:98 :63
123
+ --> $DIR/min_const_fn.rs:90 :63
160
124
|
161
125
LL | const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } }
162
126
| ^^^^^^^^^^
@@ -165,7 +129,7 @@ LL | const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize }
165
129
= help: add `#![feature(const_raw_ptr_to_usize_cast)]` to the crate attributes to enable
166
130
167
131
error[E0658]: mutable references are not allowed in constant functions
168
- --> $DIR/min_const_fn.rs:101 :14
132
+ --> $DIR/min_const_fn.rs:93 :14
169
133
|
170
134
LL | const fn inc(x: &mut i32) { *x += 1 }
171
135
| ^
@@ -174,7 +138,7 @@ LL | const fn inc(x: &mut i32) { *x += 1 }
174
138
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
175
139
176
140
error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
177
- --> $DIR/min_const_fn.rs:110 :6
141
+ --> $DIR/min_const_fn.rs:102 :6
178
142
|
179
143
LL | impl<T: std::fmt::Debug> Foo<T> {
180
144
| ^
@@ -183,7 +147,7 @@ LL | impl<T: std::fmt::Debug> Foo<T> {
183
147
= help: add `#![feature(const_fn)]` to the crate attributes to enable
184
148
185
149
error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
186
- --> $DIR/min_const_fn.rs:115 :6
150
+ --> $DIR/min_const_fn.rs:107 :6
187
151
|
188
152
LL | impl<T: std::fmt::Debug + Sized> Foo<T> {
189
153
| ^
@@ -192,7 +156,7 @@ LL | impl<T: std::fmt::Debug + Sized> Foo<T> {
192
156
= help: add `#![feature(const_fn)]` to the crate attributes to enable
193
157
194
158
error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
195
- --> $DIR/min_const_fn.rs:120 :6
159
+ --> $DIR/min_const_fn.rs:112 :6
196
160
|
197
161
LL | impl<T: Sync + Sized> Foo<T> {
198
162
| ^
@@ -201,7 +165,7 @@ LL | impl<T: Sync + Sized> Foo<T> {
201
165
= help: add `#![feature(const_fn)]` to the crate attributes to enable
202
166
203
167
error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
204
- --> $DIR/min_const_fn.rs:126 :34
168
+ --> $DIR/min_const_fn.rs:118 :34
205
169
|
206
170
LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
207
171
| ^^^^^^^^^^^^^^^^^^^^
@@ -210,7 +174,7 @@ LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
210
174
= help: add `#![feature(const_fn)]` to the crate attributes to enable
211
175
212
176
error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
213
- --> $DIR/min_const_fn.rs:128 :22
177
+ --> $DIR/min_const_fn.rs:120 :22
214
178
|
215
179
LL | const fn no_apit(_x: impl std::fmt::Debug) {}
216
180
| ^^^^^^^^^^^^^^^^^^^^
@@ -219,7 +183,7 @@ LL | const fn no_apit(_x: impl std::fmt::Debug) {}
219
183
= help: add `#![feature(const_fn)]` to the crate attributes to enable
220
184
221
185
error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
222
- --> $DIR/min_const_fn.rs:129 :23
186
+ --> $DIR/min_const_fn.rs:121 :23
223
187
|
224
188
LL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {}
225
189
| ^^
@@ -228,7 +192,7 @@ LL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {}
228
192
= help: add `#![feature(const_fn)]` to the crate attributes to enable
229
193
230
194
error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
231
- --> $DIR/min_const_fn.rs:130 :32
195
+ --> $DIR/min_const_fn.rs:122 :32
232
196
|
233
197
LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
234
198
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -237,7 +201,7 @@ LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
237
201
= help: add `#![feature(const_fn)]` to the crate attributes to enable
238
202
239
203
error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
240
- --> $DIR/min_const_fn.rs:135 :41
204
+ --> $DIR/min_const_fn.rs:127 :41
241
205
|
242
206
LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1 }
243
207
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -246,7 +210,7 @@ LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1
246
210
= help: add `#![feature(const_fn)]` to the crate attributes to enable
247
211
248
212
error[E0723]: function pointers in const fn are unstable
249
- --> $DIR/min_const_fn.rs:138 :21
213
+ --> $DIR/min_const_fn.rs:130 :21
250
214
|
251
215
LL | const fn no_fn_ptrs(_x: fn()) {}
252
216
| ^^
@@ -255,15 +219,15 @@ LL | const fn no_fn_ptrs(_x: fn()) {}
255
219
= help: add `#![feature(const_fn)]` to the crate attributes to enable
256
220
257
221
error[E0723]: function pointers in const fn are unstable
258
- --> $DIR/min_const_fn.rs:140 :27
222
+ --> $DIR/min_const_fn.rs:132 :27
259
223
|
260
224
LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
261
225
| ^^^^
262
226
|
263
227
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
264
228
= help: add `#![feature(const_fn)]` to the crate attributes to enable
265
229
266
- error: aborting due to 30 previous errors
230
+ error: aborting due to 26 previous errors
267
231
268
232
Some errors have detailed explanations: E0013, E0493, E0658, E0723.
269
233
For more information about an error, try `rustc --explain E0013`.
0 commit comments