]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/const-generics/issues/issue-71381.rs
2 #![cfg_attr(full, feature(const_generics))]
3 #![cfg_attr(full, allow(incomplete_features))]
4 #![cfg_attr(min, feature(min_const_generics))]
6 struct Test(*const usize);
10 unsafe extern "C" fn pass(args
: PassArg
) {
11 println
!("Hello, world!");
15 pub fn call_me
<Args
: Sized
, const IDX
: usize, const FN
: unsafe extern "C" fn(Args
)>(&self) {
16 //~^ ERROR: using function pointers as const generic parameters is forbidden
17 //~| ERROR: the type of const parameters must not depend on other generic parameters
18 self.0 = Self::trampiline
::<Args
, IDX
, FN
> as _
21 unsafe extern "C" fn trampiline
<
24 const FN
: unsafe extern "C" fn(Args
),
25 //~^ ERROR: using function pointers as const generic parameters is forbidden
26 //~| ERROR: the type of const parameters must not depend on other generic parameters
36 x
.call_me
::<PassArg
, 30, pass
>()