Skip to content

Commit

Permalink
make suggested modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
HTGAzureX1212 committed Feb 19, 2024
1 parent c9396cc commit edd9cf9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_lint/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ lint_identifier_non_ascii_char = identifier contains non-ASCII characters
lint_identifier_uncommon_codepoints = identifier contains {$codepoints_len ->
[one] { $identifier_type ->
[Exclusion] a Unicode codepoint that its corresponding script is no longer used
[Exclusion] a Unicode codepoint whose corresponding script is no longer used
[Technical] a Unicode codepoint that has specialized usage
[Limited_Use] a Unicode codepoint that is in limited use
[Not_NFKC] a Unicode codepoint that is not used in normalized strings
Expand Down
6 changes: 2 additions & 4 deletions compiler/rustc_lint/src/non_ascii_idents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,12 @@ impl EarlyLintPass for NonAsciiIdents {
.extract_if(|(c, _)| !GeneralSecurityProfile::identifier_allowed(*c))
.collect::<Vec<_>>();
if !remaining.is_empty() {
let remaining_len = remaining.len();

cx.emit_span_lint(
UNCOMMON_CODEPOINTS,
sp,
IdentifierUncommonCodepoints {
codepoints: remaining.iter().map(|(c, _)| *c).collect(),
codepoints_len: remaining_len,
codepoints_len: remaining.len(),
codepoints: remaining.into_iter().map(|(c, _)| c).collect(),
identifier_type: "Restricted",
},
);
Expand Down

0 comments on commit edd9cf9

Please sign in to comment.