]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/type-dependent/issue-71382.rs
Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup
[rust.git] / src / test / ui / const-generics / type-dependent / issue-71382.rs
1 #![feature(const_generics)]
2 //~^ WARN the feature `const_generics` is incomplete
3
4 struct Test;
5
6 fn pass() -> u8 {
7     42
8 }
9
10 impl Test {
11     pub fn call_me(&self) -> u8 {
12         self.test::<pass>()
13     }
14
15     fn test<const FN: fn() -> u8>(&self) -> u8 {
16         //~^ ERROR using function pointers as const generic parameters is forbidden
17         FN()
18     }
19 }
20
21 fn main() {
22     let x = Test;
23     assert_eq!(x.call_me(), 42);
24 }