mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-05-19 00:43:18 +02:00
Add a sentence about lifetime elision (#663)
add a sentence about lifetime elision
This commit is contained in:
parent
cc813973b1
commit
1c1c367940
@ -10,3 +10,6 @@ A borrowed value has a _lifetime_:
|
|||||||
yourself.
|
yourself.
|
||||||
* Lifetime annotations create constraints; the compiler verifies that there is
|
* Lifetime annotations create constraints; the compiler verifies that there is
|
||||||
a valid solution.
|
a valid solution.
|
||||||
|
* Lifetimes for function arguments and return values must be fully specified,
|
||||||
|
but Rust allows these to be elidied in most cases with [a few simple
|
||||||
|
rules](https://doc.rust-lang.org/nomicon/lifetime-elision.html).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user