about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStefan Schindler <dns2utf8@estada.ch>2016-08-20 21:54:29 +0200
committerStefan Schindler <dns2utf8@estada.ch>2016-08-20 22:13:40 +0200
commitd9bd4d5981218f2adc1249984b501935aac7beaf (patch)
tree123b5ffecdc92ebe9720f5d1ff1924a92a6be867
parent490189634b656dcca9e41e6b52093569c03bd4df (diff)
downloadrust-d9bd4d5981218f2adc1249984b501935aac7beaf.tar.gz
rust-d9bd4d5981218f2adc1249984b501935aac7beaf.zip
Add docs for "!" empty Never type (rfc 1216)
-rw-r--r--src/doc/book/syntax-index.md5
-rw-r--r--src/doc/grammar.md7
2 files changed, 11 insertions, 1 deletions
diff --git a/src/doc/book/syntax-index.md b/src/doc/book/syntax-index.md
index 0259db221b6..1e05b01d30d 100644
--- a/src/doc/book/syntax-index.md
+++ b/src/doc/book/syntax-index.md
@@ -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.
diff --git a/src/doc/grammar.md b/src/doc/grammar.md
index be64379b516..690d44cc2cb 100644
--- a/src/doc/grammar.md
+++ b/src/doc/grammar.md
@@ -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?