Skip to content

Commit

Permalink
Rollup merge of rust-lang#35286 - dns2utf8:doc_never_expression, r=ni…
Browse files Browse the repository at this point in the history
…komatsakis

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

Pull Request: rust-lang/rfcs#1216
Tracking Issue: rust-lang#35121
  • Loading branch information
Jonathan Turner authored Sep 29, 2016
2 parents 86affcd + d9bd4d5 commit 83c54dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/doc/book/syntax-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)].
Expand Down Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions src/doc/grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 83c54dc

Please sign in to comment.