Skip to content

Commit 599ec81

Browse files
joshtriplettdumindu
authored andcommitted
Update some text about borrow checking for accuracy
There's a common misconception that the borrow checker contributes substantially to Rust compilation time. However, this isn't the case; borrow checking is not a substantial part of compilation time.
1 parent bec97e3 commit 599ec81

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/en/docs/c3.lifetimes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ In Rust,
2323
* When dealing with **references**, we have to specify **lifetime annotations** to provide instructions for the **compiler** to set **how long** those referenced resources **should be alive**.
2424
* ⭐ But because of lifetime annotations make the **code more verbose**, in order to make **common patterns** more ergonomic, Rust allows lifetimes to be **elided/omitted** in `fn` definitions. In this case, the compiler assigns lifetime annotations **implicitly**.
2525

26-
Lifetime annotations are **checked at compile-time**. Compiler checks when a data is used for the first and the last times. According to that, Rust manages memory in **run time**. This is the major reason for **slower compilation times** in Rust.
26+
Lifetime annotations are **checked at compile-time**. The compiler checks when data is used for the first and the last times.
2727

28-
> * Unlike C and C++, **usually**, Rust doesn’t explicitly drop values at all.
28+
> * Unlike C and C++, **usually**, Rust doesn’t require explicitly dropping values at all.
2929
> * Unlike GC, Rust doesn’t place deallocation calls where the data is no longer referenced.
3030
> * Rust places deallocation calls where the data is about to go out of the scope and then enforces that no references to that resource exist after that point.
3131

0 commit comments

Comments
 (0)