File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -398,7 +398,7 @@ lint_incomplete_include =
398
398
lint_inner_macro_attribute_unstable = inner macro attributes are unstable
399
399
400
400
lint_invalid_asm_label_binary = avoid using labels containing only the digits `0` and `1` in inline assembly
401
- .help = use a different number that has at least one digit 2 or greater
401
+ .label = use a different label that doesn't start with `0` or `1`
402
402
.note = an LLVM bug makes these labels ambiguous with a binary literal number
403
403
.note = see <https://bugs.llvm.org/show_bug.cgi?id=36144> for more information
404
404
Original file line number Diff line number Diff line change @@ -2815,7 +2815,7 @@ declare_lint! {
2815
2815
///
2816
2816
/// fn main() {
2817
2817
/// unsafe {
2818
- /// asm!("0: bar ");
2818
+ /// asm!("0: jmp 0b ");
2819
2819
/// }
2820
2820
/// }
2821
2821
/// ```
@@ -2824,11 +2824,15 @@ declare_lint! {
2824
2824
///
2825
2825
/// ### Explanation
2826
2826
///
2827
- /// A bug in LLVM causes this code to fail
2827
+ /// A [LLVM bug] causes this code to fail to compile because it interprets the `0b` as a binary
2828
+ /// literal instead of a reference to the previous local label `0`. Note that even though the
2829
+ /// bug is marked as fixed, it only fixes a specific usage of intel syntax within standalone
2830
+ /// files, not inline assembly. To work around this bug, don't use labels that could be
2831
+ /// confused with a binary literal.
2828
2832
///
2829
2833
/// See the explanation in [Rust By Example] for more details.
2830
2834
///
2831
- /// [local labels ]: https://sourceware. org/binutils/docs/as/Symbol-Names.html#Local-Labels
2835
+ /// [LLVM bug ]: https://bugs.llvm. org/show_bug.cgi?id=36144
2832
2836
/// [Rust By Example]: https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels
2833
2837
pub BINARY_ASM_LABELS ,
2834
2838
Deny ,
You can’t perform that action at this time.
0 commit comments