`asm!` lints should be based on `cfg` rather than target
Open
Nobody has claimed this yet.
A-inline-assembly
A-lints
C-enhancement
T-compiler
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
For example:
#[cfg(target_arch = "x86")]
fn foo() {
unsafe { asm!("0: jmp 0b") };
}
This currently raises binary_asm_labels only if targeting x86. Ideally we would be able to raise the lint regardless of what the current target is.
Requested in https://github.com/rust-lang/rust/issues/127821 and https://github.com/rust-lang/rust/pull/127935
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the asm! lint handling described in this issue and compare the requested behavior with issues #127821 and pull request #127935. Done means binary_asm_labels can be raised based on the applicable cfg regardless of the current compilation target.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100