# Blog post: never patterns, exhaustive matching, and uninhabited types

**URL:** <https://internals.rust-lang.org/t/blog-post-never-patterns-exhaustive-matching-and-uninhabited-types/8197>\
**Category:** Uncategorized\
**Created:** [August 13, 2018, 9:56pm UTC](https://internals.rust-lang.org/t/blog-post-never-patterns-exhaustive-matching-and-uninhabited-types/8197 "2018-08-13T21:56:44Z")\
**Posts on this page:** 1\
**Showing post:** 59

<div class="post-metadata">

**Author:** ![RalfJung](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/ralfjung/32/2415_2.png) [@RalfJung](https://internals.rust-lang.org/u/RalfJung)\
**Post date:** [August 23, 2018, 10:27am UTC](https://internals.rust-lang.org/t/blog-post-never-patterns-exhaustive-matching-and-uninhabited-types/8197/59 "2018-08-23T10:27:58Z")

</div>

Having [finally written that blog post on validity of values](https://internals.rust-lang.org/t/two-kinds-of-invariants-safety-and-validity/8264), I can now clarify why I think there are multiple notions of “uninhabited”: Some types do not have any _valid_ inhabitants – they are as uninhabited as it gets. Examples are `!` or any empty enum, but also `(i32, !)`.

Other types do not have any _safe_ inhabitants, but they _might_ have valid inhabitants. An example of such a type is

```rust
struct Recursive<'a>(&'a mut Recursive<'a>);

```

According to my definition, `Recursive(MaybeUninit::<Recursive>::get_mut())` is _valid_ for `Recursive` but _not safe_ – there is no safe inhabitant.

---

_[View the full topic](https://internals.rust-lang.org/t/blog-post-never-patterns-exhaustive-matching-and-uninhabited-types/8197)._
