about summary refs log tree commit diff
path: root/tests/ui/layout/base-layout-is-sized-ice-123078.rs
blob: bbe32b2022af0dd67c71bde05ee2e5973162a580 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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 the type `S` has an unknown layout
//~| ERROR cannot transmute between types of different sizes, or dependently-sized types

const _: [(); {
    C;
    0
}] = [];

pub fn main() {}