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

Reasons for feature removals are not translatable #123920

Open
Xiretza opened this issue Apr 14, 2024 · 0 comments
Open

Reasons for feature removals are not translatable #123920

Xiretza opened this issue Apr 14, 2024 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Xiretza
Copy link
Contributor

Xiretza commented Apr 14, 2024

Code

#![feature(box_syntax)]

fn main() {}

Current output

error[E0557]: feature has been removed
 --> foo.rs:1:12
  |
1 | #![feature(box_syntax)]
  |            ^^^^^^^^^^ feature has been removed
  |
  = note: replaced with `#[rustc_box]`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0557`.

Desired output

The note ("replaced with #[rustc_box]") should be translatable, rather than hard-coded in compiler/rustc_feature/src/removed.rs.

Rationale and extra context

The reason field in RemovedFeature cannot simply be replaced with a DiagMessage because rustc_features cannot depend on rustc_errors (cyclic dependency). I don't know how to solve this.

Other cases

No response

Rust Version

rustc 1.79.0-nightly (79424056b 2024-04-12)
binary: rustc
commit-hash: 79424056b05eaa9563d16dfab9b9a0c8f033f220
commit-date: 2024-04-12
host: x86_64-unknown-linux-gnu
release: 1.79.0-nightly
LLVM version: 18.1.3

Anything else?

No response

@Xiretza Xiretza added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 14, 2024
@jieyouxu jieyouxu added the A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic label Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants