mirror of
https://github.com/rust-lang/book.git
synced 2026-12-01 17:06:09 -06:00
Merge pull request #4284 from reitzig/patch-1
Ch. 10.3: clarify language detail
This commit is contained in:
@@ -8,8 +8,8 @@ One detail we didn’t discuss in the [“References and
|
||||
Borrowing”][references-and-borrowing]<!-- ignore --> section in Chapter 4 is
|
||||
that every reference in Rust has a _lifetime_, which is the scope for which
|
||||
that reference is valid. Most of the time, lifetimes are implicit and inferred,
|
||||
just like most of the time, types are inferred. We must annotate types only
|
||||
when multiple types are possible. In a similar way, we must annotate lifetimes
|
||||
just like most of the time, types are inferred. We only have to annotate types
|
||||
when multiple types are possible. In a similar way, we have to annotate lifetimes
|
||||
when the lifetimes of references could be related in a few different ways. Rust
|
||||
requires us to annotate the relationships using generic lifetime parameters to
|
||||
ensure the actual references used at runtime will definitely be valid.
|
||||
|
||||
Reference in New Issue
Block a user