Skip to content

"avoid using named labels" mis-identifies inst operand as label #143021

@androm3da

Description

@androm3da

Code

// In hexagon assembly syntax, register pairs are delimited with colons like `r17:16`.


pub unsafe fn hexagon_regpair_example() {
    asm!(
        // this instruction performs a double-word load to r1 and r0
        "r1:0 = memd(r29+#0)",
        lateout("r0") _, lateout("r1") _
    );
}

Current output

error: avoid using named labels in inline assembly
  --> src/lib.rs:23:10
   |
23 |         "r1:0 = memd(r29+#0)",
   |          ^^
   |

Desired output

<not an error - no diagnostic emitted>

Rationale and extra context

No response

Other cases

Rust Version

$ rustc --version
rustc 1.89.0-nightly (49a8ba068 2025-06-14)

Anything else?

If you have a pointer to other similar "narrowing the pattern matched for this diag" commit(s) I can make the change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-inline-assemblyArea: Inline assembly (`asm!(…)`)A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.L-false-positiveLint: False positive (should not have fired).T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions