# Const generics master doc
not strictly necessary things are marked with in italics.
cc https://hackmd.io/dwO7dvv5RI-ob1d5P5QDQA?view
## adt const params
- structural equality
- opt in vs backcompat concerns
- function pointers
## generic constants
- unused substs
- **Potential Solution**: only consider generic parameters explicitly mentioned and predicates only containing generic parameters which are explicitly mentioned when typechecking anon consts.
- behavior may be surprising, e.g.
- self referential where clauses
- eval without first checking where-clauses
- we currently do not eval if there are inference vars because of this.
## impls
- constraining generic parameters `impl<const N: usize> Trait for UsesOption<{ Some(N) }> {}`
- *exhaustiveness: `mpl Trait<true> for ()` and `impl Trait<false> for ()` implies `impl<const B: bool> Trait<B> {}`*
### unification
- want to avoid accidentally stabilising desugarings by allowing things to unify that desugar to the same thir/mir/whateverweuse
- `inner(outer(N))` has to unify with `inner(M)` with `M = outer(N)` for gce to be composable. i.e. we have to "split" constants
- valtrees and padding
- not necessary if only named constants are allowed, no need to split stuff.
- *partial eval: `X + (1 + 2)` should unify with `X + 3`*
- *associativity: `N + 2` with `M + 1` and `M <- N + 1`*
- *commutativity: `1 + N + 1` with `N + 2`*
### Const evaluatability bounds
### const evaluatable unchecked future compat lint