about summary refs log tree commit diff
path: root/tests/ui/const-generics/issues/issue-71382.rs
blob: 8878a4434c46f826b72ceb35b8ce9418987d9c2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//@ revisions: full min
#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]

struct Test();

fn pass() {
    println!("Hello, world!");
}

impl Test {
    pub fn call_me(&self) {
        self.test::<pass>();
    }

    fn test<const FN: fn()>(&self) {
        //~^ ERROR: using function pointers as const generic parameters is forbidden
        FN();
    }
}

fn main() {
    let x = Test();
    x.call_me()
}