Add a regression test for #32498

This commit is contained in:
Bram van den Heuvel 2021-02-09 14:42:04 +01:00
parent 921ec4b3fc
commit b29d7166f2

View File

@ -0,0 +1,16 @@
// run-pass
#![allow(dead_code)]
// Making sure that no overflow occurs.
struct L<T> {
n: Option<T>,
}
type L8<T> = L<L<L<L<L<L<L<L<T>>>>>>>>;
type L64<T> = L8<L8<L8<L8<T>>>>;
fn main() {
use std::mem::size_of;
assert_eq!(size_of::<L64<L64<()>>>(), 1);
assert_eq!(size_of::<L<L64<L64<()>>>>(), 1);
}