Skip to content

Improve diagnostics for usage of qualified paths within tuple struct exprs/pats #140370

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

WaffleLapkin
Copy link
Member

@WaffleLapkin WaffleLapkin commented Apr 27, 2025

For patterns the old diagnostic was just incorrect, but I also added machine applicable suggestions.

For context, this special cases errors for <T as Trait>::Assoc(..) patterns and expressions (latter is just a call). Tuple struct patterns and expressions both live in the value namespace, so they are not forwarded through associated types.

r? @jdonszelmann

cc @petrochenkov in #80080 (comment) you were wondering why it doesn't work for types, that's why — tuple patterns are resolved in the value namespace.

1. Better explain what the test tests
2. Test slightly more cases
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 27, 2025
1. Fix "expected" and the note for the pattern case
2. Add suggestions
@rust-log-analyzer

This comment has been minimized.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants