Skip to content

Conversation

@xonx4l
Copy link
Contributor

@xonx4l xonx4l commented Nov 7, 2025

This PR merge E0412 into E0425 as both mean the same thing to users.

This fixes #148558.

@rustbot
Copy link
Collaborator

rustbot commented Nov 7, 2025

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

This PR modifies tests/ui/issues/. If this PR is adding new tests to tests/ui/issues/,
please refrain from doing so, and instead add it to more descriptive subdirectories.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Nov 7, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 7, 2025

jieyouxu is currently at their maximum review capacity.
They may take a while to respond.

// 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`).
Copy link
Contributor

@mu001999 mu001999 Nov 8, 2025

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

Copy link
Contributor Author

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.
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok,Thanks .

@jieyouxu
Copy link
Member

jieyouxu commented Nov 8, 2025

@rustbot reroll

@rustbot rustbot assigned madsmtm and unassigned jieyouxu Nov 8, 2025
@bors
Copy link
Collaborator

bors commented Nov 9, 2025

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

@rustbot
Copy link
Collaborator

rustbot commented Nov 9, 2025

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.

@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 9, 2025
Copy link
Member

@Kivooeo Kivooeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, some questions

View changes since this review


// There are two different error messages user might receive at
// this point:
// - E0412 cannot find type `{}` in this scope
Copy link
Member

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?

Copy link
Contributor Author

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 {
Copy link
Member

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?

Copy link
Contributor Author

@xonx4l xonx4l Nov 9, 2025

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 .

Copy link
Member

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?

Copy link
Contributor Author

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 .

Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

@Kivooeo Kivooeo Nov 9, 2025

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will add .

@rust-log-analyzer

This comment has been minimized.

@xonx4l xonx4l force-pushed the EO412_replacement_with_EO425 branch from 28386ac to eee16cc Compare November 9, 2025 21:12
@rustbot
Copy link
Collaborator

rustbot commented Nov 9, 2025

Some changes occurred in src/tools/cargo

cc @ehuss

@rustbot
Copy link
Collaborator

rustbot commented Nov 9, 2025

⚠️ Warning ⚠️

@rustbot rustbot removed has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 9, 2025
@@ -1,64 +1,6 @@
A used type name is not in scope.
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Comment on lines 1131 to 1138
if let Some(correct) = Self::likely_rust_type(path) {
err.span_suggestion(
span,
"perhaps you intended to use this type",
correct,
Applicability::MaybeIncorrect,
);
}
Copy link
Member

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

Copy link
Contributor Author

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 .

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK .

@bors
Copy link
Collaborator

bors commented Nov 11, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E0412 and E0425 are redundant

8 participants