# Lattice specialisation in const generics?

**URL:** <https://internals.rust-lang.org/t/lattice-specialisation-in-const-generics/23594>\
**Category:** Uncategorized\
**Created:** [October 6, 2025, 11:03am UTC](https://internals.rust-lang.org/t/lattice-specialisation-in-const-generics/23594 "2025-10-06T11:03:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SciMind2460](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/scimind2460/32/13125_2.png) [@SciMind2460](https://internals.rust-lang.org/u/SciMind2460)\
**Post date:** [October 6, 2025, 11:03am UTC](https://internals.rust-lang.org/t/lattice-specialisation-in-const-generics/23594/1 "2025-10-06T11:03:00Z")

</div>

Continuing the discussion from [`impl Default` for generically sized arrays? (`[T; N]`)](https://internals.rust-lang.org/t/impl-default-for-generically-sized-arrays-t-n/23328/35):

Perhaps we should consider providing a comprehensive framework for const-generics and lattice specialisation? For example, we should consider a specific _value_ to be a special case of a generic value in const generics.

This would solve the `impl Default` problem, in my opinion, as a specific subtyping system will prove to Rust that the implementations discussed by @SkiFire13 and @the8472 are valid.

In my opinion, this would also be sound, as it would not suffer trans-erasure like lifetimes.

This is a very nebulous idea and I would require some help fleshing it out before submitting an RFC.

---

<div class="post-metadata">

**Author:** ![scottmcm](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/scottmcm/32/2355_2.png) [@scottmcm](https://internals.rust-lang.org/u/scottmcm)\
**Post date:** [October 6, 2025, 5:55pm UTC](https://internals.rust-lang.org/t/lattice-specialisation-in-const-generics/23594/2 "2025-10-06T17:55:45Z")

</div>

> [@SciMind2460](#):
>
> For example, we should consider a specific _value_ to be a subtype of a generic value in const generics.

I don't know what you mean here, since that's not the meaning of "subtype" I'm used to.

Are you perhaps thinking of something kinda like [lattice specialization](https://rust-lang.github.io/rfcs/1210-impl-specialization.html#the-lattice-rule)?

---

<div class="post-metadata">

**Author:** ![SciMind2460](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/scimind2460/32/13125_2.png) [@SciMind2460](https://internals.rust-lang.org/u/SciMind2460)\
**Post date:** [October 7, 2025, 2:44am UTC](https://internals.rust-lang.org/t/lattice-specialisation-in-const-generics/23594/3 "2025-10-07T02:44:53Z")

</div>

> [@scottmcm](#):
>
> [lattice specialization](https://rust-lang.github.io/rfcs/1210-impl-specialization.html#the-lattice-rule)

Yes, that's it! I think this will be safer than lifetime-based lattice specialization as const generics are carried over to trans (as per my understanding)

Edited my post to make it more clear.
