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

@ -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(