-
Notifications
You must be signed in to change notification settings - Fork 14k
Merge redundant error codes E0412 and E0425 #148758
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
Conversation
|
Some changes occurred in diagnostic error codes This PR modifies |
|
r? @nnethercote rustbot has assigned @nnethercote. Use |
This comment has been minimized.
This comment has been minimized.
91c302c to
aef895d
Compare
E0412 ("type name is not in scope") and E0425 ("unresolved name")
convey essentially the same information to users - that an identifier
cannot be found in the current scope. The only difference was that
E0412 was used for type positions while E0425 was used for value/
expression positions. This distinction was not meaningful to users.
This commit merges E0412 into E0425, making E0425 the unified error
code for all unresolved name errors regardless of position.
Changes made:
- Updated error code mapping in rustc_resolve to use E0425 for both
type and expression positions
- Updated diagnostic handling code and comments to reflect the merge
- Marked E0412 documentation as no longer emitted, noting it has been
merged into E0425
- Enhanced E0425 documentation to include type resolution examples
- Updated all test files and expected outputs to use E0425 instead of
E0412
aef895d to
c627e1c
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
As far as I see there is already a PR for that? #148678 |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
Thank you @Kivooeo for pointing out that PR #148678 already addresses this issue! I didn't see it when I started working on this. Since #148678 was opened first, I'm closing this PR to avoid duplication. If helpful, the maintainers are welcome to reference any parts of my implementation. Apologies for the duplicate work! |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Fixes #148558
Summary
This PR merges the redundant error codes E0412 and E0425 into a single unified error code (E0425).
Background
E0412 ("type name is not in scope") and E0425 ("unresolved name") conveyed essentially the same information to users - that an identifier cannot be found in the current scope. The only difference was that E0412 was used for type positions while E0425 was used for value/expression positions. This distinction was not meaningful to users and created unnecessary complexity.
Changes
Compiler changes:
rustc_resolveto use E0425 for both type and expression positionsDocumentation changes:
Test changes:
.rsfiles and 173.stderrfiles) to expect E0425 instead of E0412Testing
All tests pass successfully:
This is a cleanup change that improves consistency in error reporting without changing the user-facing error messages themselves.