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

Detect references to non-existant messages in Fluent resources #107096

Merged
merged 2 commits into from
Jan 28, 2023

Conversation

clubby789
Copy link
Contributor

@clubby789 clubby789 commented Jan 19, 2023

Should help with cases like #107091, where {variable} (a message reference) is accidentally typed, rather than {$variable} (a variable reference)

Fixes #107370

@rustbot label +A-translation

@rustbot
Copy link
Collaborator

rustbot commented Jan 19, 2023

r? @Nilstrieb

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

@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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 Jan 19, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jan 19, 2023

rustc_macros::diagnostics was changed

cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki

@rustbot
Copy link
Collaborator

rustbot commented Jan 19, 2023

rustc_error_messages was changed

cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki

@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member

r? @compiler-errors

@clubby789, is it possible for you to commit a test for this? Maybe with a bad fluent file in https://github.com/rust-lang/rust/tree/master/tests/run-make/translation ?

@clubby789
Copy link
Contributor Author

Added the test to tests/ui-fulldeps/fluent-messages/test.rs since there's other tests of the fluent_messages macro there

@rust-log-analyzer

This comment has been minimized.

@clubby789 clubby789 force-pushed the fluent-bad-messageref branch 2 times, most recently from 4c99ac9 to e8d335d Compare January 20, 2023 16:06
@bors
Copy link
Contributor

bors commented Jan 22, 2023

☔ The latest upstream changes (presumably #107187) made this pull request unmergeable. Please resolve the merge conflicts.

@clubby789
Copy link
Contributor Author

Something like #92565 would help to generate nicer diagnostics but a reference to the file/offending messages is probably the best we can do for now

@compiler-errors
Copy link
Member

I'm happy with this as-is. Thanks for implementing this!

@bors r+

@bors
Copy link
Contributor

bors commented Jan 26, 2023

📌 Commit 89b1f39 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 Jan 26, 2023
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jan 27, 2023
…=compiler-errors

Detect references to non-existant messages in Fluent resources

Should help with cases like rust-lang#107091, where `{variable}` (a message reference) is accidentally typed, rather than `{$variable}` (a variable reference)

`@rustbot` label +A-translation
@JohnTitor
Copy link
Member

Failed in rollup: #107341 (comment)
@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 27, 2023
@clubby789
Copy link
Contributor Author

HashMap -> Vec to avoid query instability
@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 27, 2023
@Noratrieb
Copy link
Member

@bors r=compiler-errors

@bors
Copy link
Contributor

bors commented Jan 27, 2023

📌 Commit 0ae0d87 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 Jan 27, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 27, 2023
…=compiler-errors

Detect references to non-existant messages in Fluent resources

Should help with cases like rust-lang#107091, where `{variable}` (a message reference) is accidentally typed, rather than `{$variable}` (a variable reference)

Fixes rust-lang#107370

`@rustbot` label +A-translation
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 28, 2023
…=compiler-errors

Detect references to non-existant messages in Fluent resources

Should help with cases like rust-lang#107091, where `{variable}` (a message reference) is accidentally typed, rather than `{$variable}` (a variable reference)

Fixes rust-lang#107370

``@rustbot`` label +A-translation
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 28, 2023
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#104012 (Improve unexpected close and mismatch delimiter hint in TokenTreesReader)
 - rust-lang#104252 (Stabilize the const_socketaddr feature)
 - rust-lang#105524 (Replace libc::{type} with crate::ffi::{type})
 - rust-lang#107096 (Detect references to non-existant messages in Fluent resources)
 - rust-lang#107355 (Add regression test for rust-lang#60755)
 - rust-lang#107384 (Remove `BOOL_TY_FOR_UNIT_TESTING`)
 - rust-lang#107385 (Use `FallibleTypeFolder` for `ConstInferUnifier` not `TypeRelation`)
 - rust-lang#107391 (rustdoc: remove inline javascript from copy-path button)
 - rust-lang#107398 (Remove `ControlFlow::{BREAK, CONTINUE}`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 53ccee0 into rust-lang:master Jan 28, 2023
@rustbot rustbot added this to the 1.69.0 milestone Jan 28, 2023
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 10, 2023
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#104012 (Improve unexpected close and mismatch delimiter hint in TokenTreesReader)
 - rust-lang#104252 (Stabilize the const_socketaddr feature)
 - rust-lang#105524 (Replace libc::{type} with crate::ffi::{type})
 - rust-lang#107096 (Detect references to non-existant messages in Fluent resources)
 - rust-lang#107355 (Add regression test for rust-lang#60755)
 - rust-lang#107384 (Remove `BOOL_TY_FOR_UNIT_TESTING`)
 - rust-lang#107385 (Use `FallibleTypeFolder` for `ConstInferUnifier` not `TypeRelation`)
 - rust-lang#107391 (rustdoc: remove inline javascript from copy-path button)
 - rust-lang#107398 (Remove `ControlFlow::{BREAK, CONTINUE}`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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.

[ICE]: Encountered errors while formatting message for codegen_ssa_apple_sdk_error_sdk_path
7 participants