]> git.proxmox.com Git - rustc.git/blame - src/doc/reference/src/types/never.md
New upstream version 1.41.1+dfsg1
[rustc.git] / src / doc / reference / src / types / never.md
CommitLineData
13cf67c4
XL
1# Never type
2
3> **<sup>Syntax</sup>**\
4> _NeverType_ : `!`
5
6The never type `!` is a type with no values, representing the result of
7computations that never complete. Expressions of type `!` can be coerced into
8any other type.
60c5eb7d
XL
9
10```rust,should_panic
11#![feature(never_type)]
12let x: ! = panic!();
13// Can be coerced into any type.
14let y: u32 = x;
15```
16
17**NB.** The never type was expected to be stabilized in 1.41, but due
18to some last minute regressions detected the stabilization was
19temporarily reverted. The `!` type can only appear in function return
20types presently. See [the tracking
21issue](https://github.com/rust-lang/rust/issues/35121) for more
22details.