Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/ch20-01-unsafe-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,9 @@ support but which can be problematic with Rust’s ownership rules. If two
threads are accessing the same mutable global variable, it can cause a data
race.

In Rust, global variables are called _static_ variables. Listing 20-10 shows an
Rust doesn’t have a dedicated “global variable” keyword; instead, it has
_static_ variables, which live for the entire program and can be declared at
module scope (globally) or inside a function (locally). Listing 20-10 shows an
example declaration and use of a static variable with a string slice as a
value.

Expand Down