summaryrefslogtreecommitdiffstats
path: root/src/doc/reference/src/types/never.md
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc/reference/src/types/never.md')
-rw-r--r--src/doc/reference/src/types/never.md23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/doc/reference/src/types/never.md b/src/doc/reference/src/types/never.md
index e32674272..3fbd2ad5c 100644
--- a/src/doc/reference/src/types/never.md
+++ b/src/doc/reference/src/types/never.md
@@ -7,16 +7,17 @@ The never type `!` is a type with no values, representing the result of
computations that never complete. Expressions of type `!` can be coerced into
any other type.
-<!-- ignore: unstable -->
-```rust,ignore
-let x: ! = panic!();
-// Can be coerced into any type.
-let y: u32 = x;
+The `!` type can **only** appear in function return types presently,
+indicating it is a diverging function that never returns.
+
+```rust
+fn foo() -> ! {
+ panic!("This call never returns.");
+}
```
-**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.
+```rust
+extern "C" {
+ pub fn no_return_extern_func() -> !;
+}
+```