From bb6b27ad1de9629a27ec851ae12b43fc8995a993 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 28 Oct 2024 02:12:15 -0700 Subject: [PATCH 1/2] =?UTF-8?q?races:=20Clarify=20a=20=E2=80=9Cmostly?= =?UTF-8?q?=E2=80=9D=20that=20might=20be=20misread?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One might carelessly misread a sentence that begins “data races are *mostly* prevented” as suggesting that Rust fails to prevent some data races. Clarify the intended reading. Signed-off-by: Anders Kaseorg --- src/races.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/races.md b/src/races.md index d5f1ea0..aaeaf5b 100644 --- a/src/races.md +++ b/src/races.md @@ -7,7 +7,7 @@ Safe Rust guarantees an absence of data races, which are defined as: * one or more of them is unsynchronized A data race has Undefined Behavior, and is therefore impossible to perform in -Safe Rust. Data races are *mostly* prevented through Rust's ownership system: +Safe Rust. Data races are prevented *mostly* through Rust's ownership system alone: it's impossible to alias a mutable reference, so it's impossible to perform a data race. Interior mutability makes this more complicated, which is largely why we have the Send and Sync traits (see the next section for more on this). From 91a7128bb35c96fa2373fe6e032c73d5d71ee6e5 Mon Sep 17 00:00:00 2001 From: Tim McCormack Date: Sat, 16 Nov 2024 08:36:29 -0500 Subject: [PATCH 2/2] Fix typo in what-unsafe-does --- src/what-unsafe-does.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/what-unsafe-does.md b/src/what-unsafe-does.md index 3fb0721..535b79e 100644 --- a/src/what-unsafe-does.md +++ b/src/what-unsafe-does.md @@ -41,7 +41,7 @@ language cares about is preventing the following things: [`NonNull`] that is null. (Requesting custom invalid values is an unstable feature, but some stable libstd types, like `NonNull`, make use of it.) -For a more detailed explanation about "Undefined Bahavior", you may refer to +For a more detailed explanation about "Undefined Behavior", you may refer to [the reference][behavior-considered-undefined]. "Producing" a value happens any time a value is assigned, passed to a