fix: show qualified paths when type names collide in E0308 - #22964
Merged
ChayimFriedman2 merged 1 commit intoJul 31, 2026
Merged
Conversation
ChayimFriedman2
requested changes
Jul 30, 2026
This comment has been minimized.
This comment has been minimized.
rit3sh-x
force-pushed
the
fix/22331-qualified-paths-on-type-name-collision
branch
from
July 31, 2026 10:13
378bccb to
f467deb
Compare
Collaborator
|
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. |
Contributor
Author
|
@ChayimFriedman2 I shortened the test suite for this implementation. Let me know if you think anything could be improved or changed. |
ChayimFriedman2
approved these changes
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A type mismatch between two same-named types from different modules currently renders with no usable information:
Before:
expected S, found SAfter:
expected foo::S, found bar::SWhen both sides of the mismatch render to the same string, they are re-rendered with
display_source_code, which resolves module paths viafind_path. The extra work only happens when the strings are equal, so the common path is unchanged. If either side has no renderable path, both keep their plain names, half-qualified message would read worse than the current one.Nesting falls out of the existing recursion, so
Option<foo::S>vsOption<bar::S>is covered too.