1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-05-31 06:37:39 +02:00

Remove confusing speaker note from Shared-References slide (#2659)

Dangling references are discussed later in the "Borrowing" segment.

Fixes #2656
This commit is contained in:
Dustin J. Mitchell 2025-02-26 11:48:54 -05:00 committed by GitHub
parent 1a64c9ba9a
commit 08c613326a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -53,10 +53,9 @@ value.
that value was mutable. Try `*r = 'X'`.
- Rust is tracking the lifetimes of all references to ensure they live long
enough. Dangling references cannot occur in safe Rust. `x_axis` would return a
reference to `point`, but `point` will be deallocated when the function
returns, so this will not compile.
enough. Dangling references cannot occur in safe Rust.
- We will talk more about borrowing when we get to ownership.
- We will talk more about borrowing and preventing dangling references when we
get to ownership.
</details>