Skip to content

Commit c6d9943

Browse files
committed
fix mdbook test
1 parent 87e3552 commit c6d9943

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/borrow_check/region_inference/constraint_propagation.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ have to compute `Values(R1) = Values(R1) union Values(R2)`.
8888
One observation that follows from this is that if you have `R1: R2`
8989
and `R2: R1`, then `R1 = R2` must be true. Similarly, if you have:
9090

91-
```
91+
```txt
9292
R1: R2
9393
R2: R3
9494
R3: R4
@@ -119,7 +119,7 @@ context.
119119
When using a graph representation, we can detect regions that must be equal
120120
by looking for cycles. That is, if you have a constraint like
121121

122-
```
122+
```txt
123123
'a: 'b
124124
'b: 'c
125125
'c: 'd
@@ -153,7 +153,7 @@ When we compute SCCs, we not only figure out which regions are a
153153
member of each SCC, we also figure out the edges between them. So for example
154154
consider this set of outlives constraints:
155155

156-
```
156+
```txt
157157
'a: 'b
158158
'b: 'a
159159
@@ -178,7 +178,7 @@ expressed in terms of regions -- that is, we have a map like
178178
in terms of SCCs -- we can integrate these liveness constraints very
179179
easily just by taking the union:
180180

181-
```
181+
```txt
182182
for each region R:
183183
let S be the SCC that contains R
184184
Values(S) = Values(S) union Liveness(R)
@@ -195,7 +195,7 @@ the value of `S1`, we first compute the values of each successor `S2`.
195195
Then we simply union all of those values together. To use a
196196
quasi-iterator-like notation:
197197

198-
```
198+
```txt
199199
Values(S1) =
200200
s1.successors()
201201
.map(|s2| Values(s2))

src/borrow_check/region_inference/lifetime_parameters.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ derives from the fact that such lifetimes are "universally quantified"
77
lifetimes). It is worth spending a bit of discussing how lifetime
88
parameters are handled during region inference. Consider this example:
99

10-
```rust
10+
```rust,ignore
1111
fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
1212
x
1313
}
@@ -92,7 +92,7 @@ itself). In the code, these liveness constraints are setup in
9292

9393
So, consider the first example of this section:
9494

95-
```rust
95+
```rust,ignore
9696
fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
9797
x
9898
}
@@ -102,7 +102,7 @@ Here, returning `x` requires that `&'a u32 <: &'b u32`, which gives
102102
rise to an outlives constraint `'a: 'b`. Combined with our default liveness
103103
constraints we get:
104104

105-
```
105+
```txt
106106
'a live at {B, end('a)} // B represents the "function body"
107107
'b live at {B, end('b)}
108108
'a: 'b

src/borrow_check/region_inference/member_constraints.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ some `i`). These constraints cannot be expressed by users, but they
66
arise from `impl Trait` due to its lifetime capture rules. Consider a
77
function such as the following:
88

9-
```rust
9+
```rust,ignore
1010
fn make(a: &'a u32, b: &'b u32) -> impl Trait<'a, 'b> { .. }
1111
```
1212

@@ -15,7 +15,7 @@ permitted to capture the lifetimes `'a` or `'b`. You can kind of see
1515
this more clearly by desugaring that `impl Trait` return type into its
1616
more explicit form:
1717

18-
```rust
18+
```rust,ignore
1919
type MakeReturn<'x, 'y> = impl Trait<'x, 'y>;
2020
fn make(a: &'a u32, b: &'b u32) -> MakeReturn<'a, 'b> { .. }
2121
```
@@ -34,14 +34,14 @@ To help us explain member constraints in more detail, let's spell out
3434
the `make` example in a bit more detail. First off, let's assume that
3535
you have some dummy trait:
3636

37-
```rust
37+
```rust,ignore
3838
trait Trait<'a, 'b> { }
3939
impl<T> Trait<'_, '_> for T { }
4040
```
4141

4242
and this is the `make` function (in desugared form):
4343

44-
```rust
44+
```rust,ignore
4545
type MakeReturn<'x, 'y> = impl Trait<'x, 'y>;
4646
fn make(a: &'a u32, b: &'b u32) -> MakeReturn<'a, 'b> {
4747
(a, b)
@@ -52,7 +52,7 @@ What happens in this case is that the return type will be `(&'0 u32, &'1 u32)`,
5252
where `'0` and `'1` are fresh region variables. We will have the following
5353
region constraints:
5454

55-
```
55+
```txt
5656
'0 live at {L}
5757
'1 live at {L}
5858
'a: '0
@@ -73,7 +73,7 @@ u32)` -- the region variables reflect that the lifetimes of these
7373
references could be made smaller. For this value to be created from
7474
`a` and `b`, however, we do require that:
7575

76-
```
76+
```txt
7777
(&'a u32, &'b u32) <: (&'0 u32, &'1 u32)
7878
```
7979

0 commit comments

Comments
 (0)