diff options
Diffstat (limited to 'tests/ui/mir/static-by-value-str.rs')
| -rw-r--r-- | tests/ui/mir/static-by-value-str.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/mir/static-by-value-str.rs b/tests/ui/mir/static-by-value-str.rs new file mode 100644 index 00000000000..88b72f90819 --- /dev/null +++ b/tests/ui/mir/static-by-value-str.rs @@ -0,0 +1,15 @@ +//! Regression test for #139872 +//! KnownPanicsLint used to assert ABI compatibility in the interpreter, +//! which ICEs with unsized statics. + +enum E { + V16(u16), + V32(u32), +} + +static C: (E, u16, str) = (E::V16(0xDEAD), 0x600D, 0xBAD); +//~^ ERROR the size for values of type `str` cannot be known + +pub fn main() { + let (_, n, _) = C; +} |
