1
Fork 0
rust/src/test/ui/const-generics/fn-const-param-call.rs
Oliver Scherer 9245ba8304 Remove the const_raw_ptr_comparison feature gate.
We can never supply a meaningful implementation of this.
Instead, the follow up commits will create two intrinsics
that approximate comparisons:

* `ptr_maybe_eq`
* `ptr_maybe_ne`

The fact that `ptr_maybe_eq(a, b)` is not necessarily the same
value as `!ptr_maybe_ne(a, b)` is a symptom of this entire
problem.
2020-06-19 18:13:41 +02:00

19 lines
428 B
Rust

#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete
fn function() -> u32 {
17
}
struct Wrapper<const F: fn() -> u32>; //~ ERROR: using function pointers as const generic parameters
impl<const F: fn() -> u32> Wrapper<F> {
//~^ ERROR: using function pointers as const generic parameters
fn call() -> u32 {
F()
}
}
fn main() {
assert_eq!(Wrapper::<function>::call(), 17);
}