Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Rust
/
Lifetime elision and annotations
What does one lifetime name shared by two parameters and a return value guarantee?
from Lifetime elision and annotations
Rust 1.98
intermediate
1 min
What does one lifetime name shared by two parameters and a return value guarantee?
Both input borrows are valid for a caller-chosen region in which the result may be used.
Both owners must be created and dropped in the same lexical block.
The function extends the shorter owner to match the longer owner.
The result is always borrowed from the first parameter.
Check
Ask AI about this kata
Report an error
previous kata
Review generated borrowed key view
Review AI code
next kata
Spot the bug in the local reference
Spot the bug
A new version is available
Reload