Skip to content

Commit 3ea7c90

Browse files
committed
Add fixme comment to revert change once const_panic is stable
1 parent 3cfa0a0 commit 3ea7c90

File tree

1 file changed

+2
-0
lines changed
  • compiler/rustc_index/src

1 file changed

+2
-0
lines changed

compiler/rustc_index/src/vec.rs

+2
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ macro_rules! newtype_index {
124124

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

133134
#[inline]
134135
$v const fn from_u32(value: u32) -> Self {
136+
// FIXME: replace with `assert!(value <= $max);` once `const_panic` is stable
135137
[()][(value > $max) as usize];
136138
unsafe {
137139
Self::from_u32_unchecked(value)

0 commit comments

Comments
 (0)