]> git.lizzy.rs Git - rust.git/commitdiff
Add docs for "!" empty Never type (rfc 1216)
authorStefan Schindler <dns2utf8@estada.ch>
Sat, 20 Aug 2016 19:54:29 +0000 (21:54 +0200)
committerStefan Schindler <dns2utf8@estada.ch>
Sat, 20 Aug 2016 20:13:40 +0000 (22:13 +0200)
src/doc/book/syntax-index.md
src/doc/grammar.md

index 0259db221b6bc0dbaa0a47c94e7386eec91d22a3..1e05b01d30d46531843a8b1a3cd45767f0013772 100644 (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)].
 * `/*!…*/`: 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.
index be64379b516e797a69272868254692b940586f66..690d44cc2cb7bc1585624121a5f99724df337957 100644 (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?