Skip to content

Commit f9cf9f5

Browse files
committed
Fix CI
1 parent 375350a commit f9cf9f5

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

src/expressions/block-expr.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ r[expr.block.type.diverging]
6767
A block is itself considered to be [diverging](../divergence.md) if all reachable control flow paths contain a [diverging expression](../divergence.md), unless that expression is a [place expression](../expressions.md#r-expr.place-value.place-memory-location) that is not read from.
6868

6969
```rust,no_run
70+
# #![ feature(never_type) ]
7071
# fn make<T>() -> T { loop {} }
7172
fn no_control_flow() -> ! {
7273
// There are no conditional statements, so this entire block is diverging.
@@ -95,19 +96,15 @@ struct Foo {
9596
x: !,
9697
}
9798
98-
fn diverging_place_read() -> () {
99+
fn diverging_place_read() -> ! {
99100
let foo = Foo { x: make() };
100-
let _: ! = {
101-
// A read of a place expression produces a diverging block
102-
let _x = foo.x;
103-
};
101+
// A read of a place expression produces a diverging block
102+
let _x = foo.x;
104103
}
105104
fn diverging_place_not_read() -> () {
106105
let foo = Foo { x: make() };
107-
let _: () = {
108-
// Asssignment to `_` means the place is not read
109-
let _ = foo.x;
110-
};
106+
// Asssignment to `_` means the place is not read
107+
let _ = foo.x;
111108
}
112109
```
113110

src/expressions/match-expr.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,15 @@ r[expr.match.empty]
103103
If there are no match arms, then the `match` expression is diverging and the type is [`!`](../types/never.md).
104104

105105
> [!EXAMPLE]
106-
```rust
107-
# fn make<T>() -> T { loop {} }
108-
enum Empty {}
109-
110-
fn diverging_match_no_arms() -> ! {
111-
let e: Empty = make();
112-
let
113-
match e {}
114-
}
115-
```
106+
> ```rust
107+
> # fn make<T>() -> T { loop {} }
108+
> enum Empty {}
109+
>
110+
> fn diverging_match_no_arms() -> ! {
111+
> let e: Empty = make();
112+
> match e {}
113+
> }
114+
> ```
116115
117116
118117
r[expr.match.conditional]

0 commit comments

Comments
 (0)