As the compiler error says, this is not currently possible in stable Rust:
error: generic parameters may not be used in const operations
--> src/lib.rs:11:40
|
11 | pub fn div_2(&self) -> ElevLayer<{ N / 2 }> {
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
In nightly Rust, this can be done by enabling the generic_const_exprs feature, but it's still incomplete and often results in spurious compiler errors.