Add fixme comment to revert change once const_panic is stable
This commit is contained in:
parent
3cfa0a0dff
commit
3ea7c90a94
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue