2024-09-15 22:16:21 +02:00
|
|
|
// 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!();
|
2025-05-28 10:29:08 +00:00
|
|
|
//~^ ERROR the type `(dyn Sync, ())` has an unknown layout
|
2024-09-15 22:16:21 +02:00
|
|
|
|
|
|
|
|
fn main() {}
|