1
0
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:
Dustin J. Mitchell 2023-05-23 11:31:35 -04:00 committed by GitHub
parent cc813973b1
commit 1c1c367940
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,3 +10,6 @@ A borrowed value has a _lifetime_:
yourself.
* Lifetime annotations create constraints; the compiler verifies that there is
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).