File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -7,16 +7,17 @@ The never type `!` is a type with no values, representing the result of
77computations that never complete. Expressions of type ` ! ` can be coerced into
88any other type.
99
10- <!-- ignore: unstable -->
11- ``` rust,ignore
12- let x: ! = panic!();
13- // Can be coerced into any type.
14- let y: u32 = x;
10+ The ` ! ` type can ** only** appear in function return types presently,
11+ indicating it is a diverging function that never returns.
12+
13+ ``` rust
14+ fn foo () -> ! {
15+ panic! (" This call never returns." );
16+ }
1517```
1618
17- ** NB.** The never type was expected to be stabilized in 1.41, but due
18- to some last minute regressions detected the stabilization was
19- temporarily reverted. The ` ! ` type can only appear in function return
20- types presently. See [ the tracking
21- issue] ( https://github.com/rust-lang/rust/issues/35121 ) for more
22- details.
19+ ``` rust
20+ extern " C" {
21+ pub fn no_return_extern_func () -> ! ;
22+ }
23+ ```
You can’t perform that action at this time.
0 commit comments