rust/tests/ui/const-generics/issues/issue-71382.rs
2024-02-16 20:02:50 +00:00

26 lines
451 B
Rust

//@ 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()
}