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