1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-04 03:25:08 +02:00

Update static-and-const.md (#215)

Let's not use the word "lifetime" just yet. It is arguably the heaviest topic in Rust and it was not yet introduced.
This commit is contained in:
Igor Petruk 2023-01-23 16:15:54 +00:00 committed by GitHub
parent c116ef8567
commit 49c9ba692e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,7 @@ fn main() {
}
```
As noted in the [Rust RFC Book][1], these are not inlined upon use and have an actual associated memory location. This is useful for unsafe and embedded code, and have a `'static` lifetime.
As noted in the [Rust RFC Book][1], these are not inlined upon use and have an actual associated memory location. This is useful for unsafe and embedded code, and the variable lives through the entirety of the program execution.
We will look at mutating static data in the [chapter on Unsafe Rust](../unsafe.md).