@@ -186,14 +186,13 @@ With the `unsafe` block, we’re asserting to Rust that we’ve read the functio
186
186
documentation, we understand how to use it properly, and we’ve verified that
187
187
we’re fulfilling the contract of the function.
188
188
189
- > Note: In earlier versions of Rust, the body of an unsafe function was treated
190
- > as an ` unsafe ` block, so you could perform any unsafe operation within the
191
- > body of an ` unsafe ` function. In later versions of Rust, the compiler will
192
- > warn you that you need to use an ` unsafe ` block to perform unsafe operations
193
- > in the body of an unsafe function. This is because Rust now distinguishes
194
- > between ` unsafe fn ` , which defines what you need to do to call the function
195
- > safely, and an ` unsafe ` block, where you actually uphold that “contract” the
196
- > function establishes.
189
+ > Note: In earlier editions of Rust, the body of an unsafe function was treated
190
+ > as an ` unsafe ` block, so you could perform any unsafe operation within it.
191
+ > Starting with the 2024 edition, the compiler will warn you that you need to
192
+ > use an ` unsafe ` block to perform unsafe operations even in the body of an
193
+ > unsafe function. This helps to keep ` unsafe ` blocks as small as possible, as
194
+ > unsafe operations may not be needed across the whole function body. For more
195
+ > information about Rust editions, refer to [ Appendix E] [ editions ] .
197
196
198
197
#### Creating a Safe Abstraction over Unsafe Code
199
198
@@ -540,4 +539,5 @@ that the code you have written upholds Rust’s rules.
540
539
[the- slice- type ]: ch04- 03- slices. html#the- slice- type
541
540
[reference]: .. / reference/ items/ unions. html
542
541
[miri]: https: // github.com/rust-lang/miri
542
+ [editions]: appendix- 05- editions. html
543
543
[nightly]: appendix- 07- nightly- rust. html
0 commit comments