mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
support nonzero* niche optimizations
This commit is contained in:
parent
86b5b609f1
commit
f2c9502185
3 changed files with 73 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue