Skip to content

Commit 41d59d9

Browse files
committed
refactor(utils): [T]::as_mut_ptr is now unstably const fn
<rust-lang/rust#77097> (merged on Sep 26, 2020)
1 parent c43d3bf commit 41d59d9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/r3/src/utils/for_times.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ macro_rules! const_array_from_fn {
203203
) => {{
204204
use core::mem::MaybeUninit;
205205
use $crate::utils::for_times::Nat;
206-
let array = [MaybeUninit::uninit(); $len_value];
206+
let mut array = [MaybeUninit::uninit(); $len_value];
207207

208208
if array.len() != <$len as Nat>::N {
209209
unreachable!();
@@ -228,8 +228,7 @@ macro_rules! const_array_from_fn {
228228
}
229229

230230
(0..$len).for_each(|i| iter::<[$($ctx_t),*], i>(
231-
// FIXME: `[T]::as_mut_ptr` is not `const fn` yet
232-
&mut ($ctx, array.as_ptr() as *mut _)
231+
&mut ($ctx, array.as_mut_ptr())
233232
))
234233
}
235234

0 commit comments

Comments
 (0)