Reasons for feature removals are not translatable
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in compiler/rustc_feature/src/removed.rs and inspect the RemovedFeature reason field, then trace how rustc_features and rustc_errors are connected. Determine an approach that preserves the dependency constraints while making the removal note translatable. Done means the hard-coded replacement note is emitted through the compiler's translation system.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100