mirror of
https://github.com/rust-lang/book.git
synced 2026-05-17 00:23:04 -04:00
Convert Listing 10-17 to <Listing>
This commit is contained in:
@@ -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, we’ve 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
|
||||
|
||||
Reference in New Issue
Block a user