Skip to content

Commit a22dcf6

Browse files
authored
Merge pull request #1072 from severen/patch-1
Improve wording around the compiler vs borrow checker
2 parents 8410e96 + 48925b1 commit a22dcf6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/scope/lifetime.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Lifetimes
22

3-
A *lifetime* is a construct the compiler (also called the borrow checker)
4-
uses to ensure all borrows are valid. Specifically, a variable's lifetime
5-
begins when it is created and ends when it is destroyed. While lifetimes
6-
and scopes are often referred to together, they are not the same.
3+
A *lifetime* is a construct the compiler (or more specifically, its *borrow
4+
checker*) uses to ensure all borrows are valid. Specifically, a variable's
5+
lifetime begins when it is created and ends when it is destroyed. While
6+
lifetimes and scopes are often referred to together, they are not the same.
77

8-
Take, for example, the case where we borrow a variable via `&`. The
9-
borrow has a lifetime that is determined by where it is declared. As a result,
10-
the borrow is valid as long as it ends before the lender is destroyed. However,
8+
Take, for example, the case where we borrow a variable via `&`. The
9+
borrow has a lifetime that is determined by where it is declared. As a result,
10+
the borrow is valid as long as it ends before the lender is destroyed. However,
1111
the scope of the borrow is determined by where the reference is used.
1212

13-
In the following example and in the rest of this section, we will see how
13+
In the following example and in the rest of this section, we will see how
1414
lifetimes relate to scopes, as well as how the two differ.
1515

1616
```rust,editable

0 commit comments

Comments
 (0)