From d5ba0cb399ea8c3a1a5eced724dad8c648dc8bb4 Mon Sep 17 00:00:00 2001 From: Guillaume Boisseau Date: Thu, 21 Mar 2024 02:01:08 +0100 Subject: [PATCH] Stabilize `min_exhaustive_patterns` --- src/exotic-sizes.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/exotic-sizes.md b/src/exotic-sizes.md index c4a6d24..5e6a395 100644 --- a/src/exotic-sizes.md +++ b/src/exotic-sizes.md @@ -137,9 +137,9 @@ because the `Err` case doesn't actually exist (strictly speaking, this is only an optimization that is not guaranteed, so for example transmuting one into the other is still Undefined Behavior). -The following *could* also compile: +The following also compiles: -```rust,compile_fail +```rust enum Void {} let res: Result = Ok(0); @@ -148,8 +148,6 @@ let res: Result = Ok(0); let Ok(num) = res; ``` -But this trick doesn't work yet. - One final subtle detail about empty types is that raw pointers to them are actually valid to construct, but dereferencing them is Undefined Behavior because that wouldn't make sense.