rust/tests/ui/layout/invalid-unsized-const-eval.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

15 lines
492 B
Rust

// issue: #124182
//! This test used to trip an assertion in const eval, because `layout_of(LazyLock)`
//! returned `Ok` with an unsized layout when a sized layout was expected.
//! It was fixed by making `layout_of` always return `Err` for types that
//! contain unsized fields in unexpected locations.
struct LazyLock {
data: (dyn Sync, ()), //~ ERROR the size for values of type
}
static EMPTY_SET: LazyLock = todo!();
//~^ ERROR could not evaluate static initializer
fn main() {}