Static rustc_lint::builtin::BINARY_ASM_LABELS
source · pub static BINARY_ASM_LABELS: &LintExpand description
The binary_asm_labels lint detects the use of numeric labels containing only binary
digits in the inline asm! macro.
§Example
ⓘ
use std::arch::asm;
fn main() {
unsafe {
asm!("0: jmp 0b");
}
}{{produces}}
§Explanation
A LLVM bug causes this code to fail to compile because it interprets the 0b as a binary
literal instead of a reference to the previous local label 0. Note that even though the
bug is marked as fixed, it only fixes a specific usage of intel syntax within standalone
files, not inline assembly. To work around this bug, don’t use labels that could be
confused with a binary literal.
See the explanation in Rust By Example for more details.