# Recent change to make exhaustiveness and uninhabited types play nicer together

**URL:** https://internals.rust-lang.org/t/recent-change-to-make-exhaustiveness-and-uninhabited-types-play-nicer-together/4602
**Category:** compiler
**Created:** [January 12, 2017, 6:44pm UTC](https://internals.rust-lang.org/t/recent-change-to-make-exhaustiveness-and-uninhabited-types-play-nicer-together/4602 "2017-01-12T18:44:41Z")
**Posts on this page:** 1
**Showing post:** 71

<div class="post-metadata">

### Author: ![mystor](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/mystor/32/6542_2.png) [@mystor](https://internals.rust-lang.org/u/mystor)
#### Post date: [January 19, 2017, 7:55pm UTC](https://internals.rust-lang.org/t/recent-change-to-make-exhaustiveness-and-uninhabited-types-play-nicer-together/4602/71 "2017-01-19T19:55:51Z")

</div>

The workaround I currently use for opaque types is also really awful:

```rust
mod foo { #[repr(C)] pub struct Foo([u8;0]); }

```

Which, like your solution using `u8` instead of `[u8;0]` also runs into the moving problems, but has the advantage of being zero sized which means that things like `mem::swap`-ing between pointers of that type is a no-op.

My suggested solution at one point to this problem was [[Pre-RFC] Opaque Structs](https://internals.rust-lang.org/t/pre-rfc-opaque-structs/4005) - but the thread didn’t seem to go anywhere.

---

_[View the full topic](https://internals.rust-lang.org/t/recent-change-to-make-exhaustiveness-and-uninhabited-types-play-nicer-together/4602)._
