Skip to content

Commit

Permalink
Add a regression test for #32498
Browse files Browse the repository at this point in the history
  • Loading branch information
vandenheuvel committed Feb 9, 2021
1 parent 921ec4b commit b29d716
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/test/ui/generics/issue-32498.rs
@@ -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);
}

0 comments on commit b29d716

Please sign in to comment.