about summary refs log tree commit diff
path: root/tests/ui/enum
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-11-03 18:55:19 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-11-03 18:55:19 +0000
commite26ad8b67d31fa8c35bf1e5e3ed310c06418d18b (patch)
tree3bfae5a137ab99d08680b61b93831f010d16422f /tests/ui/enum
parent06fc531c9631989ed681fc7252929da3ff84225e (diff)
downloadrust-e26ad8b67d31fa8c35bf1e5e3ed310c06418d18b.tar.gz
rust-e26ad8b67d31fa8c35bf1e5e3ed310c06418d18b.zip
Properly suggest `E::assoc` when we encounter `E::Variant::assoc`
Use the right span when encountering an enum variant followed by an associated item so we don't lose the associated item in the resulting code.

Do not suggest the thing twice, once as a removal of the associated item and a second time as a typo suggestion.
Diffstat (limited to 'tests/ui/enum')
-rw-r--r--tests/ui/enum/assoc-fn-call-on-variant.stderr2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/ui/enum/assoc-fn-call-on-variant.stderr b/tests/ui/enum/assoc-fn-call-on-variant.stderr
index 4775201d2bb..47fc630c923 100644
--- a/tests/ui/enum/assoc-fn-call-on-variant.stderr
+++ b/tests/ui/enum/assoc-fn-call-on-variant.stderr
@@ -6,7 +6,7 @@ LL |     E::A::f();
    |
 help: there is an enum variant `E::A`; try using the variant's enum
    |
-LL |     E();
+LL |     E::f();
    |     ~
 
 error: aborting due to 1 previous error