Skip to content

Commit

Permalink
refactor(utils): [T]::as_mut_ptr is now unstably const fn
Browse files Browse the repository at this point in the history
<rust-lang/rust#77097> (merged on Sep 26, 2020)
  • Loading branch information
yvt committed Dec 5, 2021
1 parent c43d3bf commit 41d59d9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/r3/src/utils/for_times.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ macro_rules! const_array_from_fn {
) => {{
use core::mem::MaybeUninit;
use $crate::utils::for_times::Nat;
let array = [MaybeUninit::uninit(); $len_value];
let mut array = [MaybeUninit::uninit(); $len_value];

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

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

Expand Down

0 comments on commit 41d59d9

Please sign in to comment.