From 7c309f307b2abe1a5a40eeff2065d6e133501b93 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Sat, 14 Dec 2019 14:57:06 -0500 Subject: [PATCH] introduce feature gate into never-type test --- src/types/never.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/types/never.md b/src/types/never.md index 6f483d901..80105b1cd 100644 --- a/src/types/never.md +++ b/src/types/never.md @@ -8,7 +8,15 @@ computations that never complete. Expressions of type `!` can be coerced into any other type. ```rust,should_panic +#![feature(never_type)] let x: ! = panic!(); // Can be coerced into any type. let y: u32 = x; ``` + +**NB.** The never type was expected to be stabilized in 1.41, but due +to some last minute regressions detected the stabilization was +temporarily reverted. The `!` type can only appear in function return +types presently. See [the tracking +issue](https://github.com/rust-lang/rust/issues/35121) for more +details.