diff options
| author | bors <bors@rust-lang.org> | 2016-10-11 13:29:02 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-11 13:29:02 -0700 |
| commit | 0b2c356420c155373d312f4b7063fd19983dfd20 (patch) | |
| tree | 9d9a14ac0b50f2f722feeda144f71ac341cb104b /src/doc | |
| parent | 304d0c8d8544ed0afcb57b32572b948fb5072f59 (diff) | |
| parent | 30164c21fa0451e00b19bab22d15b9866edd97f1 (diff) | |
Auto merge of #37090 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 9 pull requests - Successful merges: #36679, #36699, #36997, #37040, #37060, #37065, #37072, #37073, #37081 - Failed merges:
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/book/lifetimes.md | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/doc/book/lifetimes.md b/src/doc/book/lifetimes.md index f7d9c94bc45..e865609f217 100644 --- a/src/doc/book/lifetimes.md +++ b/src/doc/book/lifetimes.md @@ -56,8 +56,12 @@ To fix this, we have to make sure that step four never happens after step three. The ownership system in Rust does this through a concept called lifetimes, which describe the scope that a reference is valid for. -When we have a function that takes an argument by reference, we can be -implicit or explicit about the lifetime of the reference: +**Note** It's important to understand that lifetime annotations are +_descriptive_, not _prescriptive_. This means that how long a reference is valid +is determined by the code, not by the annotations. The annotations, however, +give information about lifetimes to the compiler that uses them to check the +validity of references. The compiler can do so without annotations in simple +cases, but needs the programmers support in complex scenarios. ```rust // implicit |
