Skip to content

Commit d3290a9

Browse files
committed
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.
1 parent 9b2bd19 commit d3290a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/undefined_behavior.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ arrangement of safe code can cause undefined behavior. That's a lot to consider!
159159
The "safety conditions" for unsafe traits and functions are just the conditions
160160
under which it does not trigger undefined behavior. These conditions aren't
161161
checked by the compiler, they're checked by the people who write the code
162-
itself. Therefore, unsafe blocks must be manually checked to verify that the
163-
code written upholds all of the conditions required to avoid undefined behavior.
164-
Any unsafe code that can trigger undefined behavior _even when its safety
162+
itself. Therefore, unsafe impls and blocks must be manually checked to verify
163+
that the code written upholds all of the conditions required to avoid undefined
164+
behavior. Any unsafe code that can trigger undefined behavior _when its safety
165165
conditions are upheld_ is unsound.
166166

167167

0 commit comments

Comments
 (0)