Skip to content

Commit 3b9543c

Browse files
authored
Rollup merge of #107446 - clubby789:rustc-parse-diag-migrate, r=compiler-errors
Migrate some of `rustc_parse` to derive diagnostics `@rustbot` label +A-translation r? rust-lang/diagnostics cc #100717
2 parents c40919b + 521c5f3 commit 3b9543c

File tree

9 files changed

+655
-380
lines changed

9 files changed

+655
-380
lines changed

compiler/rustc_error_messages/locales/en-US/parse.ftl

+115
Original file line numberDiff line numberDiff line change
@@ -585,3 +585,118 @@ parse_negative_bounds_not_supported = negative bounds are not supported
585585
parse_help_set_edition_cargo = set `edition = "{$edition}"` in `Cargo.toml`
586586
parse_help_set_edition_standalone = pass `--edition {$edition}` to `rustc`
587587
parse_note_edition_guide = for more on editions, read https://doc.rust-lang.org/edition-guide
588+
589+
parse_unexpected_token_after_dot = unexpected token: `{$actual}`
590+
591+
parse_cannot_be_raw_ident = `{$ident}` cannot be a raw identifier
592+
593+
parse_cr_doc_comment = bare CR not allowed in {$block ->
594+
[true] block doc-comment
595+
*[false] doc-comment
596+
}
597+
598+
parse_no_digits_literal = no valid digits found for number
599+
600+
parse_invalid_digit_literal = invalid digit for a base {$base} literal
601+
602+
parse_empty_exponent_float = expected at least one digit in exponent
603+
604+
parse_float_literal_unsupported_base = {$base} float literal is not supported
605+
606+
parse_more_than_one_char = character literal may only contain one codepoint
607+
.followed_by = this `{$chr}` is followed by the combining {$len ->
608+
[one] mark
609+
*[other] marks
610+
} `{$escaped_marks}`
611+
.non_printing = there are non-printing characters, the full sequence is `{$escaped}`
612+
.consider_normalized = consider using the normalized form `{$ch}` of this character
613+
.remove_non = consider removing the non-printing characters
614+
.use_double_quotes = if you meant to write a {$is_byte ->
615+
[true] byte string
616+
*[false] `str`
617+
} literal, use double quotes
618+
619+
parse_no_brace_unicode_escape = incorrect unicode escape sequence
620+
.label = {parse_no_brace_unicode_escape}
621+
.use_braces = format of unicode escape sequences uses braces
622+
.format_of_unicode = format of unicode escape sequences is `\u{"{...}"}`
623+
624+
parse_invalid_unicode_escape = invalid unicode character escape
625+
.label = invalid escape
626+
.help = unicode escape must {$surrogate ->
627+
[true] not be a surrogate
628+
*[false] be at most 10FFFF
629+
}
630+
631+
parse_escape_only_char = {$byte ->
632+
[true] byte
633+
*[false] character
634+
} constant must be escaped: `{$escaped_msg}`
635+
.escape = escape the character
636+
637+
parse_bare_cr = {$double_quotes ->
638+
[true] bare CR not allowed in string, use `\r` instead
639+
*[false] character constant must be escaped: `\r`
640+
}
641+
.escape = escape the character
642+
643+
parse_bare_cr_in_raw_string = bare CR not allowed in raw string
644+
645+
parse_too_short_hex_escape = numeric character escape is too short
646+
647+
parse_invalid_char_in_escape = {parse_invalid_char_in_escape_msg}: `{$ch}`
648+
.label = {parse_invalid_char_in_escape_msg}
649+
650+
parse_invalid_char_in_escape_msg = invalid character in {$is_hex ->
651+
[true] numeric character
652+
*[false] unicode
653+
} escape
654+
655+
parse_out_of_range_hex_escape = out of range hex escape
656+
.label = must be a character in the range [\x00-\x7f]
657+
658+
parse_leading_underscore_unicode_escape = {parse_leading_underscore_unicode_escape_label}: `_`
659+
parse_leading_underscore_unicode_escape_label = invalid start of unicode escape
660+
661+
parse_overlong_unicode_escape = overlong unicode escape
662+
.label = must have at most 6 hex digits
663+
664+
parse_unclosed_unicode_escape = unterminated unicode escape
665+
.label = missing a closing `{"}"}`
666+
.terminate = terminate the unicode escape
667+
668+
parse_unicode_escape_in_byte = unicode escape in byte string
669+
.label = {parse_unicode_escape_in_byte}
670+
.help = unicode escape sequences cannot be used as a byte or in a byte string
671+
672+
parse_empty_unicode_escape = empty unicode escape
673+
.label = this escape must have at least 1 hex digit
674+
675+
parse_zero_chars = empty character literal
676+
.label = {parse_zero_chars}
677+
678+
parse_lone_slash = invalid trailing slash in literal
679+
.label = {parse_lone_slash}
680+
681+
parse_unskipped_whitespace = non-ASCII whitespace symbol '{$ch}' is not skipped
682+
.label = {parse_unskipped_whitespace}
683+
684+
parse_multiple_skipped_lines = multiple lines skipped by escaped newline
685+
.label = skipping everything up to and including this point
686+
687+
parse_unknown_prefix = prefix `{$prefix}` is unknown
688+
.label = unknown prefix
689+
.note = prefixed identifiers and literals are reserved since Rust 2021
690+
.suggestion_br = use `br` for a raw byte string
691+
.suggestion_whitespace = consider inserting whitespace here
692+
693+
parse_too_many_hashes = too many `#` symbols: raw strings may be delimited by up to 255 `#` symbols, but found {$num}
694+
695+
parse_unknown_start_of_token = unknown start of token: {$escaped}
696+
.sugg_quotes = Unicode characters '“' (Left Double Quotation Mark) and '”' (Right Double Quotation Mark) look like '{$ascii_str}' ({$ascii_name}), but are not
697+
.sugg_other = Unicode character '{$ch}' ({$u_name}) looks like '{$ascii_str}' ({$ascii_name}), but it is not
698+
.help_null = source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
699+
.note_repeats = character appears {$repeats ->
700+
[one] once more
701+
*[other] {$repeats} more times
702+
}

0 commit comments

Comments
 (0)