Improve diagnostics for usage of qualified paths within tuple struct exprs/pats by WaffleLapkin · Pull Request #140370 · rust-lang/rust (original) (raw)

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.