Skip to content

Commit 4040ed0

Browse files
committed
Address Niko's comments.
1 parent fa9825d commit 4040ed0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/divergence.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ r[divergence]
22
# Divergence
33

44
r[divergence.intro]
5-
Divergence is the state where a particular section of code could never be encountered at runtime. Importantly, while there are certain language constructs that immediately produce a _diverging expression_ of the type [`!`](./types/never.md), divergence can also propogate to the surrounding block.
5+
If an expression diverges, then nothing after that expression will execute. Importantly, while there are certain language constructs that immediately produce a _diverging expression_ of the type [`!`](./types/never.md), divergence can also propogate to the surrounding block --- where divergence indicates that the block itself will never finish executing.
66

77
Any expression of type [`!`](./types/never.md) is a _diverging expression_, but there are also diverging expressions which are not of type `!` (e.g. `Some(loop {})` produces a type of `Option<!>`).
88

src/expressions/block-expr.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ A block is itself considered to be [diverging](../divergence.md) if all reachabl
7070
# #![ feature(never_type) ]
7171
# fn make<T>() -> T { loop {} }
7272
fn no_control_flow() -> ! {
73-
// There are no conditional statements, so this entire block is diverging.
73+
// There are no conditional statements, so this entire function body is diverging.
7474
loop {}
7575
}
7676
7777
fn control_flow_diverging() -> ! {
78-
// All paths are diverging, so this entire block is diverging.
78+
// All paths are diverging, so this entire function body is diverging.
7979
if true {
8080
loop {}
8181
} else {

0 commit comments

Comments
 (0)