Skip to content

Commit

Permalink
Remove doc of unstable feature of never type
Browse files Browse the repository at this point in the history
  • Loading branch information
hehaoqian committed Jul 1, 2023
1 parent 6af2b46 commit b7ec900
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/types/never.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
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.
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() -> !;
}
```

0 comments on commit b7ec900

Please sign in to comment.