update cfg(bootstrap)
This commit is contained in:
parent
5d088abfb3
commit
b63ab8005a
14 changed files with 9 additions and 38 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue