# \`NonMaxUsize\` and niche value optimisation

**URL:** <https://internals.rust-lang.org/t/nonmaxusize-and-niche-value-optimisation/19661>\
**Category:** libs\
**Created:** [October 7, 2023, 8:29am UTC](https://internals.rust-lang.org/t/nonmaxusize-and-niche-value-optimisation/19661 "2023-10-07T08:29:14Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![dlight](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/dlight/32/8462_2.png) [@dlight](https://internals.rust-lang.org/u/dlight)\
**Post date:** [October 8, 2023, 1:55pm UTC](https://internals.rust-lang.org/t/nonmaxusize-and-niche-value-optimisation/19661/13 "2023-10-08T13:55:43Z")

</div>

> [@dlight](#):
>
> e #[repr(Rust)] and generally unavailable for inspection by FFI code). My rationale is that while NonMax is a special case that doesn't generalize, it's a very useful special case.
> 
> Then, maybe add NonN under the same rationale.

Whoa, that's even better!

Maybe a plan would be, stabilize some common and useful Non\* types now on stdlib, and maybe expose the full generality of consecutive niches if and when [pattern types](https://internals.rust-lang.org/t/thoughts-on-pattern-types-and-subtyping/17675) become available.

---

_[View the full topic](https://internals.rust-lang.org/t/nonmaxusize-and-niche-value-optimisation/19661)._
