-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate trivially translatable rustc_parse
diagnostics
#110873
Conversation
r? @nnethercote (rustbot has picked a reviewer for you, use r? to override) |
span: kw_token.span, | ||
item: item.unwrap().span, | ||
kw_str, | ||
keyword: keyword.as_str(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Including a string here rather than the Symbol
as the keywords are formatted as r#enum
@@ -84,19 +84,24 @@ pub fn parse_meta<'a>(sess: &'a ParseSess, attr: &Attribute) -> PResult<'a, Meta | |||
}) | |||
} | |||
|
|||
pub fn check_meta_bad_delim(sess: &ParseSess, span: DelimSpan, delim: MacDelimiter, msg: &str) { | |||
pub fn check_meta_bad_delim(sess: &ParseSess, span: DelimSpan, delim: MacDelimiter) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split these to two diagnostics because of https://github.com/projectfluent/fluent/wiki/Good-Practices-for-Developers#prefer-wet-over-dry. I'm not entirely sure that there really needs to be a special message for cfg_attr
however
@@ -11,18 +11,24 @@ error: expected `::`, found `:` | |||
| | |||
LL | use std:fs::File; | |||
| ^ help: use double colon | |||
| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the repeated note here is bad, I can either back this out or add note_once
to the derive API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's that big of a deal. note_once
seems like overkill here honestly.
@@ -11,18 +11,24 @@ error: expected `::`, found `:` | |||
| | |||
LL | use std:fs::File; | |||
| ^ help: use double colon | |||
| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's that big of a deal. note_once
seems like overkill here honestly.
parse_expect_label_found_ident = expected a label, found an identifier | ||
.suggestion = labels start with a tick | ||
|
||
parse_inappropriate_default = {$article} {$descr} cannot be `default` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... article + descr is gonna be hard to translate. but oh well.
@bors r+ |
…ial, r=compiler-errors Migrate trivially translatable `rustc_parse` diagnostics cc rust-lang#100717 Migrate diagnostics in `rustc_parse` which are emitted in a single statement. I worked on this by expanding the lint introduced in rust-lang#108760, although that isn't included here as there is much more work to be done to satisfy it
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#110766 (More core::fmt::rt cleanup.) - rust-lang#110873 (Migrate trivially translatable `rustc_parse` diagnostics) - rust-lang#110904 (rustdoc: rebind bound vars to type-outlives predicates) - rust-lang#110913 (Add some missing built-in lints) - rust-lang#110918 (`remove_dir_all`: try deleting the directory even if `FILE_LIST_DIRECTORY` access is denied) - rust-lang#110920 (Fix unavailable url) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
cc #100717
Migrate diagnostics in
rustc_parse
which are emitted in a single statement. I worked on this by expanding the lint introduced in #108760, although that isn't included here as there is much more work to be done to satisfy it