Closed
Description
Combining this with adt_const_params
can give weird errors:
#![feature(generic_const_exprs, adt_const_params)]
struct FieldElement<const N: &'static str> {
n: [u64; num_limbs(N)],
}
const fn num_limbs(_: &str) -> usize {
0
}
Error:
error: overly complex generic constant
--> src/lib.rs:5:14
|
5 | n: [u64; num_limbs(N)],
| ^^^^^^^^^^-^
| |
| dereferencing is not supported in generic constants
|
= help: consider moving this anonymous constant into a `const` function
= note: this operation may be supported in the future
https://play.rust-lang.org/?gist=a6a2aecfba83485968a81b8599b86cc5
(I hoped I can try and play with these to see if it would be possible to implement typed algebraic fields)
Originally posted by @elichai in #76560 (comment)