Skip to content
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

Merged
merged 1 commit into from
Apr 28, 2023

Conversation

clubby789
Copy link
Contributor

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

@rustbot
Copy link
Collaborator

rustbot commented Apr 27, 2023

r? @nnethercote

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 27, 2023
span: kw_token.span,
item: item.unwrap().span,
kw_str,
keyword: keyword.as_str(),
Copy link
Contributor Author

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) {
Copy link
Contributor Author

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
|
Copy link
Contributor Author

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

Copy link
Member

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
|
Copy link
Member

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`
Copy link
Member

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.

@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Apr 27, 2023

📌 Commit 1ce9d72 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 27, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 27, 2023
…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
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 28, 2023
…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
@bors bors merged commit 29f5ec3 into rust-lang:master Apr 28, 2023
@rustbot rustbot added this to the 1.71.0 milestone Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants