mirror of https://github.com/rust-lang/rust.git
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]
|
#[inline]
|
||||||
$v const fn from_usize(value: usize) -> Self {
|
$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];
|
[()][(value > ($max as usize)) as usize];
|
||||||
unsafe {
|
unsafe {
|
||||||
Self::from_u32_unchecked(value as u32)
|
Self::from_u32_unchecked(value as u32)
|
||||||
|
@ -132,6 +133,7 @@ macro_rules! newtype_index {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
$v const fn from_u32(value: u32) -> Self {
|
$v const fn from_u32(value: u32) -> Self {
|
||||||
|
// FIXME: replace with `assert!(value <= $max);` once `const_panic` is stable
|
||||||
[()][(value > $max) as usize];
|
[()][(value > $max) as usize];
|
||||||
unsafe {
|
unsafe {
|
||||||
Self::from_u32_unchecked(value)
|
Self::from_u32_unchecked(value)
|
||||||
|
|
Loading…
Reference in New Issue