From e1e8774ae044683d72dd13558e791e05308c61c9 Mon Sep 17 00:00:00 2001 From: asquared31415 <34665709+asquared31415@users.noreply.github.com> Date: Wed, 26 Jun 2024 14:32:55 -0400 Subject: [PATCH] commit and message tweaks from review Co-authored-by: Esteban Kuber --- compiler/rustc_lint/messages.ftl | 2 +- compiler/rustc_lint/src/builtin.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_lint/messages.ftl b/compiler/rustc_lint/messages.ftl index 9a58c571e74c..c2913a40c408 100644 --- a/compiler/rustc_lint/messages.ftl +++ b/compiler/rustc_lint/messages.ftl @@ -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 for more information diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index f631c20f0f28..83f96d30b441 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -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; } @@ -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, '_' | '$')