mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Add fixme comment to revert change once const_panic is stable
This commit is contained in:
parent
3cfa0a0dff
commit
3ea7c90a94
@ -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…
Reference in New Issue
Block a user