support nonzero* niche optimizations

This commit is contained in:
hkalbasi 2022-10-27 23:28:34 +03:30
parent 86b5b609f1
commit f2c9502185
3 changed files with 73 additions and 0 deletions

View file

@ -29,6 +29,7 @@
//! index: sized
//! iterator: option
//! iterators: iterator, fn
//! non_zero:
//! option:
//! ord: eq, option
//! pin:
@ -680,6 +681,15 @@ mod macros {
}
// endregion:derive
// region:non_zero
pub mod num {
#[repr(transparent)]
#[rustc_layout_scalar_valid_range_start(1)]
#[rustc_nonnull_optimization_guaranteed]
pub struct NonZeroU8(u8);
}
// endregion:non_zero
// region:bool_impl
#[lang = "bool"]
impl bool {