]>
git.proxmox.com Git - rustc.git/blob - tests/ui/cast/casts-differing-anon.rs
3 fn foo() -> Box
<impl fmt
::Debug
+?Sized
> {
4 let x
: Box
<[u8]> = Box
::new([0]);
7 fn bar() -> Box
<impl fmt
::Debug
+?Sized
> {
8 let y
: Box
<dyn fmt
::Debug
> = Box
::new([0]);
16 // this is an `*mut [u8]` in practice
17 let f_raw
: *mut _
= Box
::into_raw(f
);
18 // this is an `*mut fmt::Debug` in practice
19 let mut b_raw
= Box
::into_raw(b
);
20 // ... and they should not be mixable
21 b_raw
= f_raw
as *mut _
; //~ ERROR is invalid