1
Fork 0
rust/tests/ui/layout/base-layout-is-sized-ice-123078.rs
FedericoBruzzone cef97bce7b Add TooGeneric variant to LayoutError and emit Unknown one
- `check-pass` test for a MRE of #135020
- fail test for #135138
- switch to `TooGeneric` for checking CMSE fn signatures
- switch to `TooGeneric` for compute `SizeSkeleton` (for transmute)
- fix broken tests
2025-01-27 00:37:34 +01:00

17 lines
384 B
Rust

// ICE !base.layout().is_sized()
// issue: rust-lang/rust#123078
struct S {
a: [u8],
//~^ ERROR the size for values of type `[u8]` cannot be known at compilation time
b: (),
}
const C: S = unsafe { std::mem::transmute(()) };
//~^ ERROR cannot transmute between types of different sizes, or dependently-sized types
const _: [(); {
C;
0
}] = [];
pub fn main() {}