Convert Listing 10-17 to <Listing>

This commit is contained in:
SpectralPixel
2024-06-26 13:41:29 +02:00
parent ed9eea7f40
commit ef4e451479

View File

@@ -66,12 +66,13 @@ The Rust compiler has a *borrow checker* that compares scopes to determine
whether all borrows are valid. Listing 10-17 shows the same code as Listing
10-16 but with annotations showing the lifetimes of the variables.
<Listing number="10-17" caption="Annotations of the lifetimes of `r` and `x`, named `'a` and `'b`, respectively">
```rust,ignore,does_not_compile
{{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/src/main.rs}}
```
<span class="caption">Listing 10-17: Annotations of the lifetimes of `r` and
`x`, named `'a` and `'b`, respectively</span>
</Listing>
Here, weve annotated the lifetime of `r` with `'a` and the lifetime of `x`
with `'b`. As you can see, the inner `'b` block is much smaller than the outer