]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/transmute/main.rs
1 // normalize-stderr-32bit: "`&str` \(64 bits\)" -> "`&str` ($$STR bits)"
2 // normalize-stderr-64bit: "`&str` \(128 bits\)" -> "`&str` ($$STR bits)"
4 use std
::mem
::transmute
;
6 pub trait TypeConstructor
<'a
> {
10 unsafe fn transmute_lifetime
<'a
, 'b
, C
>(x
: <C
as TypeConstructor
<'a
>>::T
)
11 -> <C
as TypeConstructor
<'b
>>::T
12 where for<'z
> C
: TypeConstructor
<'z
> {
17 let x
: u8 = transmute(10u16); //~ ERROR cannot transmute between types of different sizes
21 let x
: u8 = transmute("test"); //~ ERROR cannot transmute between types of different sizes
26 let x
: Foo
= transmute(10); //~ ERROR cannot transmute between types of different sizes