]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/transmutability/abstraction/abstracted_assume.rs
2 //! The implementation should behave correctly when the `ASSUME` parameters are
3 //! provided indirectly through an abstraction.
6 #![feature(transmutability)]
7 #![allow(dead_code, incomplete_features, non_camel_case_types)]
10 use std
::mem
::BikeshedIntrinsicFrom
;
12 pub fn is_transmutable
<
16 const ASSUME_ALIGNMENT
: bool
,
17 const ASSUME_LIFETIMES
: bool
,
18 const ASSUME_VALIDITY
: bool
,
19 const ASSUME_VISIBILITY
: bool
,
22 Dst
: BikeshedIntrinsicFrom
<
35 #[repr(C)] struct Src;
36 #[repr(C)] struct Dst;
38 assert
::is_transmutable
::<Src
, Dst
, Context
, false, false, false, false>();
43 #[repr(C)] struct Src;
44 #[repr(C)] struct Dst;
46 const FALSE
: bool
= false;
48 assert
::is_transmutable
::<Src
, Dst
, Context
, FALSE
, FALSE
, FALSE
, FALSE
>();
51 fn via_associated_const() {
53 #[repr(C)] struct Src;
54 #[repr(C)] struct Dst;
57 const FALSE
: bool
= true;
64 assert
::is_transmutable
::<