Skip to content

Commit e1e8774

Browse files
commit and message tweaks from review
Co-authored-by: Esteban Kuber <[email protected]>
1 parent b00d875 commit e1e8774

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/rustc_lint/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ lint_incomplete_include =
397397
398398
lint_inner_macro_attribute_unstable = inner macro attributes are unstable
399399
400-
lint_invalid_asm_label_binary = avoid using labels containing only the digits 0 and 1 in inline assembly
400+
lint_invalid_asm_label_binary = avoid using labels containing only the digits `0` and `1` in inline assembly
401401
.help = use a different number that has at least one digit 2 or greater
402402
.note = an LLVM bug makes these labels ambiguous with a binary literal number
403403
.note = see <https://bugs.llvm.org/show_bug.cgi?id=36144> for more information

compiler/rustc_lint/src/builtin.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2903,10 +2903,10 @@ impl<'tcx> LateLintPass<'tcx> for AsmLabels {
29032903
in_bracket = true;
29042904
label_kind = AsmLabelKind::FormatArg;
29052905
} else if matches!(start, '0' | '1') {
2906-
// binary labels have only the characters 0 or 1
2906+
// Binary labels have only the characters `0` or `1`.
29072907
label_kind = AsmLabelKind::Binary;
29082908
} else if !(start.is_ascii_alphabetic() || matches!(start, '.' | '_')) {
2909-
// named labels start with ASCII letters or . or _
2909+
// Named labels start with ASCII letters, `.` or `_`.
29102910
// anything else is not a label
29112911
break 'label_loop;
29122912
}
@@ -2934,7 +2934,7 @@ impl<'tcx> LateLintPass<'tcx> for AsmLabels {
29342934
label_kind = AsmLabelKind::FormatArg;
29352935
} else {
29362936
let can_continue = match label_kind {
2937-
// format arg labels are considered to be named labels for the purposes
2937+
// Format arg labels are considered to be named labels for the purposes
29382938
// of continuing outside of their {} pair.
29392939
AsmLabelKind::Named | AsmLabelKind::FormatArg => {
29402940
c.is_ascii_alphanumeric() || matches!(c, '_' | '$')

0 commit comments

Comments
 (0)