-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsafe Extern Blocks #3484
Unsafe Extern Blocks #3484
Commits on Sep 7, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 63441ea - Browse repository at this point
Copy the full SHA 63441eaView commit details -
Update text/0000-unsafe-extern-blocks.md
Co-authored-by: Jacob Lifshay <programmerjake@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 726478f - Browse repository at this point
Copy the full SHA 726478fView commit details
Commits on Mar 25, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 47949ec - Browse repository at this point
Copy the full SHA 47949ecView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0637684 - Browse repository at this point
Copy the full SHA 0637684View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3fa1a61 - Browse repository at this point
Copy the full SHA 3fa1a61View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7754241 - Browse repository at this point
Copy the full SHA 7754241View commit details
Commits on Mar 31, 2024
-
Update text/0000-unsafe-extern-blocks.md
Co-authored-by: Waffle Maybe <waffle.lapkin@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 2144ac3 - Browse repository at this point
Copy the full SHA 2144ac3View commit details
Commits on Apr 1, 2024
-
Update text/0000-unsafe-extern-blocks.md
Co-authored-by: Jacob Lifshay <programmerjake@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 676383f - Browse repository at this point
Copy the full SHA 676383fView commit details
Commits on Apr 2, 2024
-
Update text/0000-unsafe-extern-blocks.md
Co-authored-by: Waffle Maybe <waffle.lapkin@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for d5bb7db - Browse repository at this point
Copy the full SHA d5bb7dbView commit details
Commits on May 6, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 6dba902 - Browse repository at this point
Copy the full SHA 6dba902View commit details -
Improve wording of the drawback
During the FCP, people noticed that the wording of the drawback probably fit better with an earlier draft of this RFC. Let's incorporate that feedback before merging. (Thanks to Waffle for raising this point.)
Configuration menu - View commit details
-
Copy full SHA for 23f0acf - Browse repository at this point
Copy the full SHA 23f0acfView commit details -
Improve wording of where
safe
is allowedLet's improve the wording related to where the `safe` keyword is allowed. (Thanks to Waffle for raising this point.)
Configuration menu - View commit details
-
Copy full SHA for 1cef026 - Browse repository at this point
Copy the full SHA 1cef026View commit details -
Configuration menu - View commit details
-
Copy full SHA for 842bd55 - Browse repository at this point
Copy the full SHA 842bd55View commit details -
An incorrect declaration in an `extern` block may cause undefined behavior in the resulting program. Let's clarify that in the text. (Thanks to Waffle for raising this point.)
Configuration menu - View commit details
-
Copy full SHA for 176d73f - Browse repository at this point
Copy the full SHA 176d73fView commit details -
Clarify what we're replacing in the Reference
This RFC suggests replacements to text within the Rust Reference. Let's clarify where those sections are. (Thanks to Waffle for raising this point.)
Configuration menu - View commit details
-
Copy full SHA for 60631ce - Browse repository at this point
Copy the full SHA 60631ceView commit details -
Add reference to Rust issue 46188
There's a long history of discussion on how incorrect declarations in `extern` blocks might cause UB in programs compiled using LLVM. Let's link to one of the issues in that history. (Thanks to madsmtm for raising this question, and to RalfJ for providing this citation.)
Configuration menu - View commit details
-
Copy full SHA for fc53654 - Browse repository at this point
Copy the full SHA fc53654View commit details -
Clarify that we will "eventually" lint
This RFC means to specify that we will *eventually* issue a lint in all editions when `extern` is not prefixed with `unsafe`. Let's specify this more clearly. (Thanks to Waffle and joshtriplett for raising this point.)
Configuration menu - View commit details
-
Copy full SHA for 5cc4cc3 - Browse repository at this point
Copy the full SHA 5cc4cc3View commit details -
This document had a mix of line wrapping styles. Let's consistently unwrap the lines.
Configuration menu - View commit details
-
Copy full SHA for 4684d53 - Browse repository at this point
Copy the full SHA 4684d53View commit details -
Lowercase "undefined behavior"
The term "undefined behavior" is not a proper noun, so let's make this lowercase.
Configuration menu - View commit details
-
Copy full SHA for b423b2b - Browse repository at this point
Copy the full SHA b423b2bView commit details
Commits on May 7, 2024
-
Address feedback and questions
As this RFC was reviewed in the GitHub thread, many alternatives were proposed and questions raised. As those of us who were a bit too close to it were cursed with knowledge, the rationale for rejecting these alternatives were not fully articulated and not all of these questions were clearly answered. Let's better document these alternatives, the rationale for rejecting each, and the answers to various known questions. (Thanks to GoldsteinE, madsmtm, kennytm, samih, and tmccombs for raising these alternatives and questions.)
Configuration menu - View commit details
-
Copy full SHA for 09a088c - Browse repository at this point
Copy the full SHA 09a088cView commit details -
Add alternative of fixing LLVM (if it is a fix)
One possibility we should mention is that of changing the behavior of LLVM and then not adding `unsafe extern`, so let's mention that. (Thanks to RalfJ for raising this point.)
Configuration menu - View commit details
-
Copy full SHA for ca7713c - Browse repository at this point
Copy the full SHA ca7713cView commit details -
Clarify about fixing LLVM despite C
Even if the C standard allows for what LLVM is doing, we could still conceivably fix LLVM. In the text, let's draw this out a bit more finely. (Thanks to RalfJ for raising this point.)
Configuration menu - View commit details
-
Copy full SHA for efc671c - Browse repository at this point
Copy the full SHA efc671cView commit details -
Clarify about
unsafe_code
and edition migrationWhen people migrate to the new edition, if they have turned up the severity of the `unsafe_code` lint and they have `extern` blocks that need to be marked `unsafe`, they will see this lint as intended. Let's make a note of that. (Thanks to kennytm for raising this point.)
Configuration menu - View commit details
-
Copy full SHA for 2c106c3 - Browse repository at this point
Copy the full SHA 2c106c3View commit details -
Configuration menu - View commit details
-
Copy full SHA for c1192da - Browse repository at this point
Copy the full SHA c1192daView commit details -
Remove issue 46188 as a motivation
This RFC had used as one motivation that undefined behavior can currently result simply from having an incorrect `extern` block even if the items within are not used from Rust code. This motivation was not cited in the lang team's 2023-10-11 consensus for how and why to proceed with this RFC, and it's possible that we may be able to resolve this issue in other ways, so let's remove that motivation from this RFC. (Thanks to RalfJ for raising this point and suggesting this.)
Configuration menu - View commit details
-
Copy full SHA for 9f36a92 - Browse repository at this point
Copy the full SHA 9f36a92View commit details -
Configuration menu - View commit details
-
Copy full SHA for c198396 - Browse repository at this point
Copy the full SHA c198396View commit details -
Fix optionality of
safe
/unsafe
in guide sectionThe 2023-10-11 consensus from lang on how to move forward included that the `safe` and `unsafe` keywords would be optional within an `unsafe extern` block. The reference-level section correctly followed this consensus, but the guide-level section did not, and suggested that annotating items with these keywords was required. Let's fix that.
Configuration menu - View commit details
-
Copy full SHA for 39795a0 - Browse repository at this point
Copy the full SHA 39795a0View commit details
Commits on May 19, 2024
-
The FCP for RFC 3484 has completed with a disposition to merge. Let's prepare to merge it.
Configuration menu - View commit details
-
Copy full SHA for 3b6ae2b - Browse repository at this point
Copy the full SHA 3b6ae2bView commit details
Commits on May 20, 2024
-
We had earlier made clarifying edits to many sections, but not to all of them. Let's clarify some text in these remaining sections.
Configuration menu - View commit details
-
Copy full SHA for 45590fe - Browse repository at this point
Copy the full SHA 45590feView commit details