Skip to content

Commit

Permalink
Merge pull request #730 from nikomatsakis/never-type-feature-gate
Browse files Browse the repository at this point in the history
introduce feature gate into never-type test
  • Loading branch information
Centril authored Dec 14, 2019
2 parents 2943dd2 + 7c309f3 commit d8dfe1b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/types/never.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit d8dfe1b

Please sign in to comment.