3 unsafe fn foo() -> (i8, *const (), Option<fn()>) {
4 let i = mem::transmute(bar);
5 //~^ ERROR cannot transmute between types of different sizes, or dependently-sized types
8 let p = mem::transmute(foo);
9 //~^ ERROR can't transmute zero-sized type
12 let of = mem::transmute(main);
13 //~^ ERROR can't transmute zero-sized type
20 // Error as usual if the resulting type is not pointer-sized.
21 mem::transmute::<_, u8>(main);
22 //~^ ERROR cannot transmute between types of different sizes, or dependently-sized types
25 mem::transmute::<_, *mut ()>(foo);
26 //~^ ERROR can't transmute zero-sized type
29 mem::transmute::<_, fn()>(bar);
30 //~^ ERROR can't transmute zero-sized type
33 // No error if a coercion would otherwise occur.
34 mem::transmute::<fn(), usize>(main);
38 mem::transmute::<_, *mut ()>(Some(foo));
39 //~^ ERROR can't transmute zero-sized type
42 mem::transmute::<_, fn()>(Some(bar));
43 //~^ ERROR can't transmute zero-sized type
46 mem::transmute::<_, Option<fn()>>(Some(baz));
47 //~^ ERROR can't transmute zero-sized type
50 // No error if a coercion would otherwise occur.
51 mem::transmute::<Option<fn()>, usize>(Some(main));