-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Improve diagnostics for usage of qualified paths within tuple struct exprs/pats #140370
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
1. Better explain what the test tests 2. Test slightly more cases
1. Fix "expected" and the note for the pattern case 2. Add suggestions
This comment has been minimized.
This comment has been minimized.
82f1d10
to
8f765fc
Compare
// | ||
// If this would only add " { " and then the code below add "0: ", | ||
// rustfix would crash, because end of this suggestion is the same as start | ||
// of the suggestion below. Thus, we have to merge these... |
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.
ugh that's dumb
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.
is there an issue on rustfix for that?
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've opened rust-lang/cargo#15619
looks good to me then! @bors r+ rollup |
…elmann Improve diagnostics for usage of qualified paths within tuple struct exprs/pats 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 rust-lang#80080 (comment) you were wondering why it doesn't work for types, that's why — tuple patterns are resolved in the value namespace.
Rollup of 9 pull requests Successful merges: - #140370 (Improve diagnostics for usage of qualified paths within tuple struct exprs/pats) - #141224 (terminology: allocated object → allocation) - #141622 (implement `va_arg` for `powerpc`) - #141666 (source_span_for_markdown_range: fix utf8 violation) - #141789 (Exclude `CARGO_HOME` from `generate-copyright` in-tree determination) - #141823 (Drive-by refactor: use `OnceCell` for the reverse region SCC graph) - #141834 (Add unimplemented `current_dll_path()` for WASI) - #141846 (Fix TLS model on bootstrap for cygwin) - #141852 (resolve if-let-chain FIXME on bootstrap) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #140370 - WaffleLapkin:unqualified, r=jdonszelmann Improve diagnostics for usage of qualified paths within tuple struct exprs/pats 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.
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.