]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/type-dependent/issue-71382.rs
Rollup merge of #106692 - eggyal:mv-binary_heap.rs-binary_heap/mod.rs, r=Mark-Simulacrum
[rust.git] / tests / ui / const-generics / type-dependent / issue-71382.rs
1 struct Test;
2
3 fn pass() -> u8 {
4     42
5 }
6
7 impl Test {
8     pub fn call_me(&self) -> u8 {
9         self.test::<pass>()
10     }
11
12     fn test<const FN: fn() -> u8>(&self) -> u8 {
13         //~^ ERROR using function pointers as const generic parameters is forbidden
14         FN()
15     }
16 }
17
18 fn main() {
19     let x = Test;
20     assert_eq!(x.call_me(), 42);
21 }