mirror of https://github.com/mickael-menu/zk
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8 lines
572 B
Markdown
8 lines
572 B
Markdown
# The borrow checker
|
|
|
|
The *borrow checker* of Rust's compiler is comparing the scope of borrowed references to the scope of the owned data to prevent dangling references. It also makes sure that the relationship between *lifetimes* of several reference match.
|
|
|
|
In some deterministic patterns, the *borrow checker* automatically infer the lifetimes following [lifetime elision rules](t9i4). But when the *borrow checker* can't automatically infer the lifetimes, we need to help it by annotating our references with [generic lifetime annotations](554k).
|
|
|
|
:programming:rust:
|