]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_index/src/vec.rs
Auto merge of #83722 - jyn514:stable-help, r=estebank
[rust.git] / compiler / rustc_index / src / vec.rs
index 6b29079109e10a3a6e246120a8a9fd1254ebba9d..1b1a59a254e6fbd0bfb41e745037e49cb667babf 100644 (file)
@@ -124,6 +124,7 @@ impl $type {
 
             #[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 @@ impl $type {
 
             #[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)