2020-08-26 18:22:55 +08:00
|
|
|
// revisions: full min
|
2021-08-30 10:59:53 +02:00
|
|
|
#![cfg_attr(full, feature(adt_const_params))]
|
2020-08-26 18:22:55 +08:00
|
|
|
#![cfg_attr(full, allow(incomplete_features))]
|
2020-06-27 20:34:04 +09:00
|
|
|
|
|
|
|
struct Test();
|
|
|
|
|
|
|
|
fn pass() {
|
|
|
|
println!("Hello, world!");
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Test {
|
|
|
|
pub fn call_me(&self) {
|
|
|
|
self.test::<pass>();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test<const FN: fn()>(&self) {
|
2020-08-31 18:35:04 +08:00
|
|
|
//~^ ERROR: using function pointers as const generic parameters is forbidden
|
2020-06-27 20:34:04 +09:00
|
|
|
FN();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = Test();
|
|
|
|
x.call_me()
|
|
|
|
}
|