update cfg(bootstrap)

This commit is contained in:
Pietro Albini 2021-10-19 09:27:59 +02:00 committed by Mark Rousskov
parent 5d088abfb3
commit b63ab8005a
14 changed files with 9 additions and 38 deletions

View file

@ -124,10 +124,7 @@ macro_rules! newtype_index {
#[inline]
$v const fn from_usize(value: usize) -> Self {
#[cfg(not(bootstrap))]
assert!(value <= ($max as usize));
#[cfg(bootstrap)]
[()][(value > ($max as usize)) as usize];
unsafe {
Self::from_u32_unchecked(value as u32)
}
@ -135,10 +132,7 @@ macro_rules! newtype_index {
#[inline]
$v const fn from_u32(value: u32) -> Self {
#[cfg(not(bootstrap))]
assert!(value <= $max);
#[cfg(bootstrap)]
[()][(value > $max) as usize];
unsafe {
Self::from_u32_unchecked(value)
}