Rollup merge of #35286 - dns2utf8:doc_never_expression, r=nikomatsakis

Add docs for "!" Never type (rfc 1216)

Pull Request: https://github.com/rust-lang/rfcs/pull/1216
Tracking Issue: #35121
This commit is contained in:
Jonathan Turner 2016-09-28 20:21:50 -07:00 committed by GitHub
commit 83c54dc971
2 changed files with 11 additions and 1 deletions

View File

@ -61,7 +61,6 @@
* `-` (`- expr`): arithmetic negation. Overloadable (`Neg`).
* `-=` (`var -= expr`): arithmetic subtraction & assignment. Overloadable (`SubAssign`).
* `->` (`fn(…) -> type`, `|…| -> type`): function and closure return type. See [Functions], [Closures].
* `-> !` (`fn(…) -> !`, `|…| -> !`): diverging function or closure. See [Diverging Functions].
* `.` (`expr.ident`): member access. See [Structs], [Method Syntax].
* `..` (`..`, `expr..`, `..expr`, `expr..expr`): right-exclusive range literal.
* `..` (`..expr`): struct literal update syntax. See [Structs (Update syntax)].
@ -159,6 +158,10 @@
* `/*!…*/`: inner block doc comment. See [Comments].
* `/**…*/`: outer block doc comment. See [Comments].
<!-- Special types -->
* `!`: always empty Never type. See [Diverging Functions].
<!-- Various things involving parens and tuples -->
* `()`: empty tuple (*a.k.a.* unit), both literal and type.

View File

@ -764,6 +764,13 @@ bound-list := bound | bound '+' bound-list
bound := path | lifetime
```
### Never type
An empty type
```antlr
never_type : "!" ;
```
### Object types
**FIXME:** grammar?