Files
rust/src/test/ui/const-generics/issues/issue-71382.rs

28 lines
592 B
Rust
Raw Normal View History

// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
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) {
//[full]~^ ERROR: using function pointers as const generic parameters is forbidden
//[min]~^^ 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()
}