rust/tests/ui/const-generics/issues/issue-71382.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
451 B
Rust
Raw Normal View History

//@ revisions: full min
#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
2020-06-27 06:34:04 -05:00
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
2020-06-27 06:34:04 -05:00
FN();
}
}
fn main() {
let x = Test();
x.call_me()
}