From d3290a93fd5671274a1e5d59f958eecddd17a7c5 Mon Sep 17 00:00:00 2001 From: Julien Cretin Date: Wed, 15 Jan 2025 10:29:44 +0100 Subject: [PATCH] Minor wording updates to the undefined behavior section - Preserve the parallel between "unsafe traits and functions" at the beginning of the paragraph with "unsafe impls and blocks in the middle, by adding "impls and". - Remove "even" for the condition of unsafe code being unsound at the end of the paragraph. With my understanding of English, "even when" means that the sentence holds even when (no pun intended) the "when" condition is removed, which is not true for that sentence. Sound unsafe code can trigger undefined behavior if its safety conditions are not upheld. --- src/undefined_behavior.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/undefined_behavior.md b/src/undefined_behavior.md index e331e8a..cf425d5 100644 --- a/src/undefined_behavior.md +++ b/src/undefined_behavior.md @@ -159,9 +159,9 @@ arrangement of safe code can cause undefined behavior. That's a lot to consider! The "safety conditions" for unsafe traits and functions are just the conditions under which it does not trigger undefined behavior. These conditions aren't checked by the compiler, they're checked by the people who write the code -itself. Therefore, unsafe blocks must be manually checked to verify that the -code written upholds all of the conditions required to avoid undefined behavior. -Any unsafe code that can trigger undefined behavior _even when its safety +itself. Therefore, unsafe impls and blocks must be manually checked to verify +that the code written upholds all of the conditions required to avoid undefined +behavior. Any unsafe code that can trigger undefined behavior _when its safety conditions are upheld_ is unsound.