Skip to content
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

Forbid calls to asm!() in safe contexts #1569

Open
Tracked by #1411
CohenArthur opened this issue Oct 6, 2022 · 1 comment
Open
Tracked by #1411

Forbid calls to asm!() in safe contexts #1569

CohenArthur opened this issue Oct 6, 2022 · 1 comment

Comments

@CohenArthur
Copy link
Member

CohenArthur commented Oct 6, 2022

Needs #1568

@CohenArthur CohenArthur mentioned this issue Oct 6, 2022
11 tasks
@CohenArthur CohenArthur changed the title Use of inline assembly Forbid calls to asm!() in safe contexts Oct 6, 2022
@liamnaddell
Copy link
Contributor

@CohenArthur This issue should be closed, it is no longer present in gccrs:

liam@gentoo /tmp $ cat inline_asm_nop.rs
#![feature(rustc_attrs)]

#[rustc_builtin_macro]
macro_rules! asm {
    () => {}
}

fn main() {
        asm!("nop");
        asm!("nop",);
}
liam@gentoo /tmp $ gccrs inline_asm_nop.rs
inline_asm_nop.rs:9:9: error: use of inline assembly is unsafe and requires unsafe function or block [E0133]
    9 |         asm!("nop");
      |         ^~~
inline_asm_nop.rs:10:9: error: use of inline assembly is unsafe and requires unsafe function or block [E0133]
   10 |         asm!("nop",);
      |         ^~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants