You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bodies of unsafe functions are effectively `unsafe` blocks, so to perform other
unsafe operations within an unsafe function, we don’t need to add another
`unsafe` block.
Description of the problem: Since RFC 2585, use of unsafe language features in unsafe fns outside of unsafe blocks is being gradually deprecated. They are currently a lint that will become a warning in the 2024 edition and may become an error in the future.
Suggested fix: Remove this paragraph altogether? Or clarify, such as: "Bodies of unsafe functions used to be trated as unsafe blocks by the compiler, but this feature is being gradually removed in newer editions of Rust. Just as in a regular function, we can use unsafe blocks inside an unsafe function to gain access to unsafe superpowers." The latter would help avoid surprises when working with older code, and there might be some value in showing that the language is changing.
The text was updated successfully, but these errors were encountered:
Ah, excellent. I’ll figure out how to wordsmith this a bit, but (a) I am really glad this is happening and (b) I am really glad you flagged it up here so we can get it tweaked going forward! I have a change landed this week for it.
main
branch to see if this has already been fixed, in this file:src/ch20-01-unsafe-rust.md
URL to the section(s) of the book with this problem:
book/src/ch20-01-unsafe-rust.md
Lines 189 to 191 in 6cc1bb8
Description of the problem: Since RFC 2585, use of unsafe language features in
unsafe fn
s outside ofunsafe
blocks is being gradually deprecated. They are currently a lint that will become a warning in the 2024 edition and may become an error in the future.Suggested fix: Remove this paragraph altogether? Or clarify, such as: "Bodies of unsafe functions used to be trated as
unsafe
blocks by the compiler, but this feature is being gradually removed in newer editions of Rust. Just as in a regular function, we can useunsafe
blocks inside an unsafe function to gain access to unsafe superpowers." The latter would help avoid surprises when working with older code, and there might be some value in showing that the language is changing.The text was updated successfully, but these errors were encountered: