summaryrefslogtreecommitdiffstats
path: root/tests/ui/generics/issue-32498.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/generics/issue-32498.rs')
-rw-r--r--tests/ui/generics/issue-32498.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/generics/issue-32498.rs b/tests/ui/generics/issue-32498.rs
new file mode 100644
index 000000000..1b5440109
--- /dev/null
+++ b/tests/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);
+}