about summary refs log tree commit diff
path: root/src/test/ui/inference
diff options
context:
space:
mode:
authorDaniel Xu <dxu@dxuuu.xyz>2022-07-08 21:03:03 -0500
committerDaniel Xu <dxu@dxuuu.xyz>2022-07-08 21:03:03 -0500
commit34e9e6dff1449bddd9a66e744423797e01aec43c (patch)
tree3fa4ba6ab1c5b3b8f83b698e480fca9f29ff2dff /src/test/ui/inference
parent06754d8852bea286a3a76d373ccd17e66afb5a8b (diff)
downloadrust-34e9e6dff1449bddd9a66e744423797e01aec43c.tar.gz
rust-34e9e6dff1449bddd9a66e744423797e01aec43c.zip
Fix duplicated type annotation suggestion
Before, there was more or less duplicated suggestions to add type hints.
Fix by clearing more generic suggestions when a more specific suggestion
is possible.

This fixes #93506 .
Diffstat (limited to 'src/test/ui/inference')
-rw-r--r--src/test/ui/inference/erase-type-params-in-label.stderr8
-rw-r--r--src/test/ui/inference/issue-71732.stderr4
2 files changed, 0 insertions, 12 deletions
diff --git a/src/test/ui/inference/erase-type-params-in-label.stderr b/src/test/ui/inference/erase-type-params-in-label.stderr
index 7bb281802d2..5c52e7bcfab 100644
--- a/src/test/ui/inference/erase-type-params-in-label.stderr
+++ b/src/test/ui/inference/erase-type-params-in-label.stderr
@@ -10,10 +10,6 @@ note: required by a bound in `foo`
    |
 LL | fn foo<T, K, W: Default, Z: Default>(t: T, k: K) -> Foo<T, K, W, Z> {
    |                 ^^^^^^^ required by this bound in `foo`
-help: consider giving `foo` an explicit type, where the type for type parameter `W` is specified
-   |
-LL |     let foo: Foo<i32, &str, W, Z> = foo(1, "");
-   |            ++++++++++++++++++++++
 help: consider specifying the type arguments in the function call
    |
 LL |     let foo = foo::<T, K, W, Z>(1, "");
@@ -31,10 +27,6 @@ note: required by a bound in `bar`
    |
 LL | fn bar<T, K, Z: Default>(t: T, k: K) -> Bar<T, K, Z> {
    |                 ^^^^^^^ required by this bound in `bar`
-help: consider giving `bar` an explicit type, where the type for type parameter `Z` is specified
-   |
-LL |     let bar: Bar<i32, &str, Z> = bar(1, "");
-   |            +++++++++++++++++++
 help: consider specifying the type arguments in the function call
    |
 LL |     let bar = bar::<T, K, Z>(1, "");
diff --git a/src/test/ui/inference/issue-71732.stderr b/src/test/ui/inference/issue-71732.stderr
index db153d38aaa..04673a375cf 100644
--- a/src/test/ui/inference/issue-71732.stderr
+++ b/src/test/ui/inference/issue-71732.stderr
@@ -13,10 +13,6 @@ note: required by a bound in `HashMap::<K, V, S>::get`
    |
 LL |         K: Borrow<Q>,
    |            ^^^^^^^^^ required by this bound in `HashMap::<K, V, S>::get`
-help: consider specifying the generic argument
-   |
-LL |         .get::<Q>(&"key".into())
-   |             +++++
 help: consider specifying the type argument in the function call
    |
 LL |         .get::<Q>(&"key".into())