about summary refs log tree commit diff
path: root/tests/ui/ufcs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-06-01 19:35:41 +0200
committerGitHub <noreply@github.com>2025-06-01 19:35:41 +0200
commitcd0adc9d7b2a2c7a41df53d6a384a42fbe2fce21 (patch)
treef8e92415689f450bc2c424f4762d92fac102c267 /tests/ui/ufcs
parent9b0268a43b0a5b58f50c96ded25364037c019a61 (diff)
parent8f765fc7a15b6a2f1de93251b9f65c6156fbfe33 (diff)
downloadrust-cd0adc9d7b2a2c7a41df53d6a384a42fbe2fce21.tar.gz
rust-cd0adc9d7b2a2c7a41df53d6a384a42fbe2fce21.zip
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 https://github.com/rust-lang/rust/pull/80080#issuecomment-800630582 you were wondering why it doesn't work for types, that's why — tuple patterns are resolved in the value namespace.
Diffstat (limited to 'tests/ui/ufcs')
-rw-r--r--tests/ui/ufcs/ufcs-partially-resolved.stderr2
1 files changed, 0 insertions, 2 deletions
diff --git a/tests/ui/ufcs/ufcs-partially-resolved.stderr b/tests/ui/ufcs/ufcs-partially-resolved.stderr
index 0a9c190cb35..69d6bd74a73 100644
--- a/tests/ui/ufcs/ufcs-partially-resolved.stderr
+++ b/tests/ui/ufcs/ufcs-partially-resolved.stderr
@@ -235,8 +235,6 @@ LL |     <u8 as Dr>::X;
    |     ^^^^^^^^^^^^-
    |                 |
    |                 help: an associated function with a similar name exists: `Z`
-   |
-   = note: can't use a type alias as a constructor
 
 error[E0575]: expected associated type, found associated function `Dr::Z`
   --> $DIR/ufcs-partially-resolved.rs:54:12