-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Add hard error and migration lint for unsafe attrs #126177
Conversation
This comment has been minimized.
This comment has been minimized.
643bc06
to
86c52d6
Compare
This comment has been minimized.
This comment has been minimized.
86c52d6
to
e86eaae
Compare
This comment has been minimized.
This comment has been minimized.
e86eaae
to
9d329c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this. The implementation looks good to me overall, I just have some questions and nits.
@@ -364,6 +364,10 @@ parse_inner_doc_comment_not_permitted = expected outer doc comment | |||
.label_does_not_annotate_this = the inner doc comment doesn't annotate this {$item} | |||
.sugg_change_inner_to_outer = to annotate the {$item}, change the doc comment from inner to outer style | |||
|
|||
parse_invalid_attr_unsafe = `{$name}` is not an unsafe attribute | |||
.suggestion = remove the `unsafe(...)` | |||
.note = extraneous unsafe is not allowed in attributes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussion: should this say something like "unsafe attribute block is not permitted for safe attributes"?
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
@rustbot author |
@rustbot reviewer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this. The implementation looks good to me! Just one nit on the lint docs then r=me.
@@ -364,6 +364,10 @@ parse_inner_doc_comment_not_permitted = expected outer doc comment | |||
.label_does_not_annotate_this = the inner doc comment doesn't annotate this {$item} | |||
.sugg_change_inner_to_outer = to annotate the {$item}, change the doc comment from inner to outer style | |||
|
|||
parse_invalid_attr_unsafe = `{$name}` is not an unsafe attribute | |||
.suggestion = remove the `unsafe(...)` | |||
.note = extraneous unsafe is not allowed in attributes |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
@rustbot author |
☔ The latest upstream changes (presumably #126569) made this pull request unmergeable. Please resolve the merge conflicts. |
r=me with a rebase, but not going to block on the tiny comment nit. |
2d0a3dc
to
6c14e9e
Compare
This comment has been minimized.
This comment has been minimized.
6c14e9e
to
a23917c
Compare
@rustbot reviewer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@bors r+ |
…r=jieyouxu Add hard error and migration lint for unsafe attrs More implementation work for rust-lang#123757 This adds the migration lint for unsafe attributes, as well as making it a hard error in Rust 2024.
…kingjubilee Rollup of 9 pull requests Successful merges: - rust-lang#126177 (Add hard error and migration lint for unsafe attrs) - rust-lang#126298 (Promote loongarch64-unknown-linux-musl to Tier 2 with host tools) - rust-lang#126455 (For [E0308]: mismatched types, when expr is in an arm's body, not add semicolon ';' at the end of it.) - rust-lang#126754 (Implement `use<>` formatting in rustfmt) - rust-lang#126807 (std::unix::fs: copy simplification for apple.) - rust-lang#126845 (Weekly `cargo update`) - rust-lang#126849 (Fix 32-bit Arm reg classes by hierarchically sorting them) - rust-lang#126854 (std::unix::os::home_dir: fallback's optimisation.) - rust-lang#126861 (Migrate `run-make/invalid-library` to `rmake.rs`) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#126177 (Add hard error and migration lint for unsafe attrs) - rust-lang#126298 (Promote loongarch64-unknown-linux-musl to Tier 2 with host tools) - rust-lang#126455 (For [E0308]: mismatched types, when expr is in an arm's body, not add semicolon ';' at the end of it.) - rust-lang#126754 (Implement `use<>` formatting in rustfmt) - rust-lang#126807 (std::unix::fs: copy simplification for apple.) - rust-lang#126845 (Weekly `cargo update`) - rust-lang#126849 (Fix 32-bit Arm reg classes by hierarchically sorting them) - rust-lang#126854 (std::unix::os::home_dir: fallback's optimisation.) - rust-lang#126888 (Remove stray println from rustfmt's `rewrite_static`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#126177 - carbotaniuman:unsafe_attr_errors, r=jieyouxu Add hard error and migration lint for unsafe attrs More implementation work for rust-lang#123757 This adds the migration lint for unsafe attributes, as well as making it a hard error in Rust 2024.
More implementation work for #123757
This adds the migration lint for unsafe attributes, as well as making it a hard error in Rust 2024.