about summary refs log tree commit diff
path: root/tests/ui/issues/issue-28625.rs
blob: 54ed408e7488135eb003db6be7a6e734c5ad68a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//@ normalize-stderr: "\d+ bits" -> "N bits"

trait Bar {
    type Bar;
}

struct ArrayPeano<T: Bar> {
    data: T::Bar,
}

fn foo<T>(a: &ArrayPeano<T>) -> &[T] where T: Bar {
    unsafe { std::mem::transmute(a) } //~ ERROR cannot transmute between types of different sizes
}

impl Bar for () {
    type Bar = ();
}

fn main() {
    let x: ArrayPeano<()> = ArrayPeano { data: () };
    foo(&x);
}