mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
support nonzero* niche optimizations
This commit is contained in:
parent
86b5b609f1
commit
f2c9502185
3 changed files with 73 additions and 0 deletions
|
@ -146,6 +146,19 @@ fn tuple() {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn non_zero() {
|
||||
check_size_and_align(
|
||||
r#"
|
||||
//- minicore: non_zero, option
|
||||
use core::num::NonZeroU8;
|
||||
struct Goal(Option<NonZeroU8>);
|
||||
"#,
|
||||
1,
|
||||
1,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn niche_optimization() {
|
||||
check_size_and_align(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue