Add fixme comment to revert change once const_panic is stable

This commit is contained in:
Wilco Kusee 2021-04-03 13:07:03 +02:00
parent 3cfa0a0dff
commit 3ea7c90a94

View File

@ -124,6 +124,7 @@ macro_rules! newtype_index {
#[inline]
$v const fn from_usize(value: usize) -> Self {
// FIXME: replace with `assert!(value <= ($max as usize));` once `const_panic` is stable
[()][(value > ($max as usize)) as usize];
unsafe {
Self::from_u32_unchecked(value as u32)
@ -132,6 +133,7 @@ macro_rules! newtype_index {
#[inline]
$v const fn from_u32(value: u32) -> Self {
// FIXME: replace with `assert!(value <= $max);` once `const_panic` is stable
[()][(value > $max) as usize];
unsafe {
Self::from_u32_unchecked(value)