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

Spurious error on inline ASM #18103

Closed
Coder-256 opened this issue Sep 12, 2024 · 0 comments · Fixed by #18106
Closed

Spurious error on inline ASM #18103

Coder-256 opened this issue Sep 12, 2024 · 0 comments · Fixed by #18106
Labels
C-bug Category: bug

Comments

@Coder-256
Copy link
Contributor

rust-analyzer version: 0.3.2104-standalone

rustc version: 1.81.0 (eeb90cda1 2024-09-04)

editor or extension: VS Code extension v0.3.2104

relevant settings: N/A

repository link (if public, optional): N/A

code snippet to reproduce:

fn rdtscp() -> u64 {
    let hi: u64;
    let lo: u64;
    unsafe {
        std::arch::asm!(
            "rdtscp",
            out("rdx") hi,
            out("rax") lo,
            out("rcx") _,
            options(nomem, nostack, preserves_flags)
        );
    }
    (hi << 32) | lo
}

rust-analyzer shows an error on the line out("rcx") _:

`_` expressions may only appear on the left-hand side of an assignment

Screenshot:
Screenshot 2024-09-11 at 11 51 29 PM

@Coder-256 Coder-256 added the C-bug Category: bug label Sep 12, 2024
@bors bors closed this as completed in 58418ab Sep 12, 2024
lnicola pushed a commit to lnicola/rust that referenced this issue Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant