Skip to content

Commit d020656

Browse files
committed
Slight edits from lcnr's review
1 parent e6e11d7 commit d020656

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/divergence.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ The following language constructs unconditonally produce a _diverging expression
1818
* [A `continue` expression](./expressions/loop-expr.md#r-expr.loop.continue.type)
1919
* [A `return` expression](./expressions/return-expr.md#r-expr.return.type)
2020
* [A `match` expression with no arms](./expressions/match-expr.md#r-expr.match.type.diverging.empty)
21-
* [A `block` expression that it itself is diverging.](../expressions/block-expr.md#r-expr.block.type.diverging)
21+
* [A `block` expression that it itself is diverging.](./expressions/block-expr.md#r-expr.block.type.diverging)
2222

2323
r[divergence.diverging-expressions.conditional]
2424
In a control flow expression, if all arms diverge, then the entire expression also diverges.
2525

26+
r[divergence.diverging-expressions.place-expressions]
27+
A place expression of the type [`!`](./types/never.md) is considering _diverging_ only if it is read from.
28+
2629
r[divergence.fallback]
2730
## Fallback
2831
If a type to be inferred is only unified with diverging expressions, then that type will be inferred to be `!`.

src/expressions/block-expr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ assert_eq!(5, five);
6161
```
6262

6363
r[expr.block.type.diverging]
64-
However, if there are any values unconditionally created within a block that are [diverging](../divergence.md), then the block itself is considered diverging.
64+
A block is itself considered to be [diverging](../divergence.md) if all reachable control flow paths contain a [diverging expression](../divergence.md#r-divergence.diverging-expressions).
6565

6666
r[expr.block.value]
6767
Blocks are always [value expressions] and evaluate the last operand in value expression context.

src/expressions/match-expr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ r[expr.match.binding-restriction]
9797
Every binding of the same name must have the same type, and have the same binding mode.
9898

9999
r[expr.match.type]
100-
The type of the overall `match` expression is the least upper bound of the individual match arms.
100+
The type of the overall `match` expression is the [least upper bound](../type-coercions.md#r-coerce.least-upper-bound) of the individual match arms.
101101

102102
r[expr.match.type.diverging.empty]
103103
If there are no match arms, then the `match` expression is diverging and the type is [`!`](../types/never.md).

0 commit comments

Comments
 (0)