-
Notifications
You must be signed in to change notification settings - Fork 14k
Merge E0412 into E0425 #148678
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
base: main
Are you sure you want to change the base?
Merge E0412 into E0425 #148678
Conversation
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy This PR modifies |
|
|
compiler/rustc_resolve/src/late.rs
Outdated
| // Thus (since we're in expression-position at this point), not to | ||
| // confuse the user, we want to keep the *message* from E0433 (so | ||
| // `parent_err`), but we want *hints* from E0412 (so `err`). | ||
| // `parent_err`), but we want *hints* from the unified E0425 (so `err`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just E0425 here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, that was an inconsistency on my part. I'll change it to just E0425 to match the rest of the PR.
| @@ -1,64 +1,6 @@ | |||
| A used type name is not in scope. | |||
| This error code is no longer emitted by the compiler. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add note on the top is good enough, see E0001.md for an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok,Thanks .
|
@rustbot reroll |
|
☔ The latest upstream changes (presumably #139558) made this pull request unmergeable. Please resolve the merge conflicts. |
|
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. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, some questions
|
|
||
| // There are two different error messages user might receive at | ||
| // this point: | ||
| // - E0412 cannot find type `{}` in this scope |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why "type" was removed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a mistake will fix this.
|
|
||
| self.suggest_ident_hidden_by_hygiene(err, path, span); | ||
| } else if err_code == E0412 { | ||
| } else if err_code == E0425 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err_code == E0425 {
...
} else if err_code == E0425 {
...
}How is this supposed to work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a mistake that I did in hurry due to resolve conflict but previously I proposed this
} else if err_code == E0412 { -> ELIMINATE
// cannot find type in this scope -> PROPOSED
if we can backtrack to changes idk how you will see in that commit I made the proposed change . I did this but in hurry thinking of a simple E0412 replacement issue I just changed it to resolve conflict .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we delete this branch entirely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
branch?? then all changes will be removed .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this, we had two branches, for 0412 and 0425
So after this change, we want to remove 0412 and keep only 0425 by replacing 0412 with 0425, so now, logically it should have only one if err_code == E0425 and else if that was originally for 0412 removed? Because we now don't have 0412 and this branch will be never reached
If you see this different I'd love to hear your opinion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I see the difference and Yes we can delete this branch but we have to first move the logic we want to keep from E0412 into E0425 branch. Because we are not completely getting rid of E0412 but the goal is to merge E0412 into E0425.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but we have to first move the logic we want to keep from E0412 into E0425 branch
Can you explain more about this logic that you want to keep and move into E0425, because neither original issue or description of this pull request explaining this, so it's not obvious what exactly are we trying to do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic that I want to keep is this line: if let Some(correct) = Self::likely_rust_type(path) as I think it gives suggestions for misspelled types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like did you mean String? when one types string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why you changed this file so much? I think that previous examples and explanations was fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add new line to end of this file, not sure why is this missed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will add .
This comment has been minimized.
This comment has been minimized.
28386ac to
eee16cc
Compare
|
Some changes occurred in src/tools/cargo cc @ehuss |
|
| @@ -1,64 +1,6 @@ | |||
| A used type name is not in scope. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retain all original content, no need to edit it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reasons this get into commit, so you need to manage to remove it somehow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
| if let Some(correct) = Self::likely_rust_type(path) { | ||
| err.span_suggestion( | ||
| span, | ||
| "perhaps you intended to use this type", | ||
| correct, | ||
| Applicability::MaybeIncorrect, | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just very curious, can you please try to remove it, and see if there will be any changes in test outputs? I really wonder if this do anything or not, just for science
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok will share the output .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I did and it went something like this -:
I removed this if let Some(correct) = Self::likely_rust_type(path) -> this caused the "dead code" error for likely_rust_type -> I then removed the likely_rust_type function itself to fix the error -> After all that I ran the tests and everything passed successfully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, since there is no actual changes in the output after removing this part this would be reasonable to remove this dead code since it's never emitted,
That's interesting that this is the only place where likely_rust_type is used, so feel free to remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK .
|
☔ The latest upstream changes (presumably #148817) made this pull request unmergeable. Please resolve the merge conflicts. |
This PR merge E0412 into E0425 as both mean the same thing to users.
This fixes #148558.