Skip to content

Commit 8410348

Browse files
committed
Update the binary_asm_label message
The link pointed to a closed issue. Create a new one and point the link to it. Also add a help message to hint what change the user could make. Fixes: #127821
1 parent 9387a75 commit 8410348

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

compiler/rustc_lint/messages.ftl

+3-2
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,9 @@ lint_inner_macro_attribute_unstable = inner macro attributes are unstable
403403
404404
lint_invalid_asm_label_binary = avoid using labels containing only the digits `0` and `1` in inline assembly
405405
.label = use a different label that doesn't start with `0` or `1`
406-
.note = an LLVM bug makes these labels ambiguous with a binary literal number
407-
.note = see <https://bugs.llvm.org/show_bug.cgi?id=36144> for more information
406+
.help = start numbering with `2` instead
407+
.note1 = an LLVM bug makes these labels ambiguous with a binary literal number on x86
408+
.note2 = see <https://github.com/llvm/llvm-project/issues/99547> for more information
408409
409410
lint_invalid_asm_label_format_arg = avoid using named labels in inline assembly
410411
.help = only local labels of the form `<number>:` should be used in inline asm

compiler/rustc_lint/src/lints.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -2066,7 +2066,9 @@ pub enum InvalidAsmLabel {
20662066
missing_precise_span: bool,
20672067
},
20682068
#[diag(lint_invalid_asm_label_binary)]
2069-
#[note]
2069+
#[help]
2070+
#[note(lint_note1)]
2071+
#[note(lint_note2)]
20702072
Binary {
20712073
#[note(lint_invalid_asm_label_no_span)]
20722074
missing_precise_span: bool,

tests/ui/asm/binary_asm_labels.stderr

+15-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ error: avoid using labels containing only the digits `0` and `1` in inline assem
44
LL | asm!("0: jmp 0b");
55
| ^ use a different label that doesn't start with `0` or `1`
66
|
7-
= note: an LLVM bug makes these labels ambiguous with a binary literal number
7+
= help: start numbering with `2` instead
8+
= note: an LLVM bug makes these labels ambiguous with a binary literal number on x86
9+
= note: see <https://github.com/llvm/llvm-project/issues/99547> for more information
810
= note: `#[deny(binary_asm_labels)]` on by default
911

1012
error: avoid using labels containing only the digits `0` and `1` in inline assembly
@@ -13,31 +15,39 @@ error: avoid using labels containing only the digits `0` and `1` in inline assem
1315
LL | asm!("1: jmp 1b");
1416
| ^ use a different label that doesn't start with `0` or `1`
1517
|
16-
= note: an LLVM bug makes these labels ambiguous with a binary literal number
18+
= help: start numbering with `2` instead
19+
= note: an LLVM bug makes these labels ambiguous with a binary literal number on x86
20+
= note: see <https://github.com/llvm/llvm-project/issues/99547> for more information
1721

1822
error: avoid using labels containing only the digits `0` and `1` in inline assembly
1923
--> $DIR/binary_asm_labels.rs:13:15
2024
|
2125
LL | asm!("10: jmp 10b");
2226
| ^^ use a different label that doesn't start with `0` or `1`
2327
|
24-
= note: an LLVM bug makes these labels ambiguous with a binary literal number
28+
= help: start numbering with `2` instead
29+
= note: an LLVM bug makes these labels ambiguous with a binary literal number on x86
30+
= note: see <https://github.com/llvm/llvm-project/issues/99547> for more information
2531

2632
error: avoid using labels containing only the digits `0` and `1` in inline assembly
2733
--> $DIR/binary_asm_labels.rs:14:15
2834
|
2935
LL | asm!("01: jmp 01b");
3036
| ^^ use a different label that doesn't start with `0` or `1`
3137
|
32-
= note: an LLVM bug makes these labels ambiguous with a binary literal number
38+
= help: start numbering with `2` instead
39+
= note: an LLVM bug makes these labels ambiguous with a binary literal number on x86
40+
= note: see <https://github.com/llvm/llvm-project/issues/99547> for more information
3341

3442
error: avoid using labels containing only the digits `0` and `1` in inline assembly
3543
--> $DIR/binary_asm_labels.rs:15:15
3644
|
3745
LL | asm!("1001101: jmp 1001101b");
3846
| ^^^^^^^ use a different label that doesn't start with `0` or `1`
3947
|
40-
= note: an LLVM bug makes these labels ambiguous with a binary literal number
48+
= help: start numbering with `2` instead
49+
= note: an LLVM bug makes these labels ambiguous with a binary literal number on x86
50+
= note: see <https://github.com/llvm/llvm-project/issues/99547> for more information
4151

4252
error: aborting due to 5 previous errors
4353

0 commit comments

Comments
 (0)