diff options
Diffstat (limited to 'src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.rs')
-rw-r--r-- | src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.rs b/src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.rs new file mode 100644 index 000000000..78bda2848 --- /dev/null +++ b/src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.rs @@ -0,0 +1,16 @@ +// Make sure the compiler does not ICE when trying to generate the debuginfo name of a type that +// causes a layout error. See https://github.com/rust-lang/rust/issues/94961. + +// compile-flags:-C debuginfo=2 +// build-fail +// error-pattern: too big for the current architecture +// normalize-stderr-64bit "18446744073709551615" -> "SIZE" +// normalize-stderr-32bit "4294967295" -> "SIZE" + +#![crate_type = "rlib"] + +pub struct Foo<T>([T; usize::MAX]); + +pub fn foo() -> usize { + std::mem::size_of::<Foo<u8>>() +} |