-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Make unsafe_op_in_unsafe_fn warn-by-default starting in 2024 edition #120535
Comments
@rfcbot fcp merge |
Team member @tmandry has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
I remain skeptical of a hard error for this, but a warning than can be allowed in everything-is- @rfcbot reviewed |
Wasn't this already FCP-ed in #71668 (comment) ? Because that FCP was used in #112038 to make the lint warn-by-default in the 2024 edition: rust/compiler/rustc_lint_defs/src/builtin.rs Line 2763 in 11f32b7
|
@rustbot labels +I-lang-nominated @Urgau raises a compelling point that we seem to have already agreed to do this and in fact landed a PR in Rust 2024 to this effect. Considering again my earlier question:
That would suggest that the answer is in fact, "nothing, this is all set for Rust 2024." If this FCP merge completes, that action would of course be idempotent. Let's nominate so that if this FCP is still outstanding next week that we discuss it. |
Thanks for pointing that out, @Urgau. On the basis of the earlier FCP, I'll check the boxes of everyone who checked that FCP and leave the 10-day window for any final objections to be raised. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
@rustbot labels -I-lang-nominated As @tmandry suggested, in our call we agreed that we had already decided on this and that people had relied on that decision to land this in Rust 2024, so we'll idempotently let this FCP complete. Given that the impl for this has landed, it looks like this is done and ready for Rust 2024, which is exciting. We'll unnominate, but if any concerns do come up, please nominate for those. |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
Let's close this in favor of #123916. |
The lang team recently discussed whether we should turn on the unsafe_op_in_unsafe_fn lint by default, and whether this should be done over an edition. The consensus we came to was that we should make the lint warn-by-default and do it over an edition.
Both of these are to help mitigate the disruptiveness of the change. We don't want to discourage too strongly the use of blanket allow in crates where nesting an
unsafe
block inside everyunsafe fn
is entirely redundant and unhelpful. We also would like to make use of the edition migration mechanism to help rewrite people's code and gather feedback over time as people migrate, rather than making a big change all at once.It is possible that after gaining more experience we will want to strengthen the lint to error-by-default or to warn in all editions, but those are not part of this proposal.
The text was updated successfully, but these errors were encountered: