]> git.lizzy.rs Git - rust.git/blob - src/test/ui/transmutability/issue-101739-2.rs
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / transmutability / issue-101739-2.rs
1 #![crate_type = "lib"]
2 #![feature(transmutability)]
3 #![allow(dead_code, incomplete_features, non_camel_case_types)]
4
5 mod assert {
6     use std::mem::BikeshedIntrinsicFrom;
7
8     pub fn is_transmutable<
9         Src,
10         Dst,
11         Context,
12         const ASSUME_ALIGNMENT: bool,
13         const ASSUME_LIFETIMES: bool,
14         const ASSUME_VALIDITY: bool,
15         const ASSUME_VISIBILITY: bool,
16     >()
17     where
18         Dst: BikeshedIntrinsicFrom< //~ ERROR this trait takes at most 3 generic arguments but 6 generic arguments were supplied
19             Src,
20             Context,
21             ASSUME_ALIGNMENT,
22             ASSUME_LIFETIMES,
23             ASSUME_VALIDITY,
24             ASSUME_VISIBILITY,
25         >,
26     {}
27 }
28
29 fn via_const() {
30     struct Context;
31     #[repr(C)] struct Src;
32     #[repr(C)] struct Dst;
33
34     const FALSE: bool = false;
35
36     assert::is_transmutable::<Src, Dst, Context, FALSE, FALSE, FALSE, FALSE>();
37 }