Skip to content

Commit

Permalink
commit and message tweaks from review
Browse files Browse the repository at this point in the history
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
  • Loading branch information
asquared31415 and estebank authored Jun 26, 2024
1 parent b00d875 commit e1e8774
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_lint/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ lint_incomplete_include =
lint_inner_macro_attribute_unstable = inner macro attributes are unstable
lint_invalid_asm_label_binary = avoid using labels containing only the digits 0 and 1 in inline assembly
lint_invalid_asm_label_binary = avoid using labels containing only the digits `0` and `1` in inline assembly
.help = use a different number that has at least one digit 2 or greater
.note = an LLVM bug makes these labels ambiguous with a binary literal number
.note = see <https://bugs.llvm.org/show_bug.cgi?id=36144> for more information
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2903,10 +2903,10 @@ impl<'tcx> LateLintPass<'tcx> for AsmLabels {
in_bracket = true;
label_kind = AsmLabelKind::FormatArg;
} else if matches!(start, '0' | '1') {
// binary labels have only the characters 0 or 1
// Binary labels have only the characters `0` or `1`.
label_kind = AsmLabelKind::Binary;
} else if !(start.is_ascii_alphabetic() || matches!(start, '.' | '_')) {
// named labels start with ASCII letters or . or _
// Named labels start with ASCII letters, `.` or `_`.
// anything else is not a label
break 'label_loop;
}
Expand Down Expand Up @@ -2934,7 +2934,7 @@ impl<'tcx> LateLintPass<'tcx> for AsmLabels {
label_kind = AsmLabelKind::FormatArg;
} else {
let can_continue = match label_kind {
// format arg labels are considered to be named labels for the purposes
// Format arg labels are considered to be named labels for the purposes
// of continuing outside of their {} pair.
AsmLabelKind::Named | AsmLabelKind::FormatArg => {
c.is_ascii_alphanumeric() || matches!(c, '_' | '$')
Expand Down

0 comments on commit e1e8774

Please sign in to comment.