-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
deny(unsafe_code) should prevent global_asm!
usage.
#103078
Labels
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
@rustbot claim |
@rustbot label +C-bug +T-compiler |
rustbot
added
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Oct 16, 2022
I suppose it's probably too late to actually make it require |
that isn't even currently possible from a syntax perspective because |
Noratrieb
added a commit
to Noratrieb/rust
that referenced
this issue
Feb 20, 2024
…safe_code, r=Nilstrieb Trigger `unsafe_code` lint on invocations of `global_asm` `unsafe_code` already warns about things that don't involve the `unsafe` keyword, e.g. `#[no_mangle]`. This makes it warn on `core::arch::global_asm` too. Fixes rust-lang#103078
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Feb 20, 2024
Rollup merge of rust-lang#121318 - kadiwa4:no_assembly_in_supposedly_safe_code, r=Nilstrieb Trigger `unsafe_code` lint on invocations of `global_asm` `unsafe_code` already warns about things that don't involve the `unsafe` keyword, e.g. `#[no_mangle]`. This makes it warn on `core::arch::global_asm` too. Fixes rust-lang#103078
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Similar to how deny(unsafe_code) prevents
#[no_mangle]
from being used, it should also preventglobal_asm!
blocks from being allowed. If misused, they can do any number of strange and horrible thing simply by being within the crate.The text was updated successfully, but these errors were encountered: