about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEsteban Kuber <esteban@kuber.com.ar>2021-11-08 20:32:17 +0000
committerEsteban Kuber <esteban@kuber.com.ar>2021-12-07 02:06:56 +0000
commit3fd15c8404626c6622555e66299c9f3442bf2322 (patch)
tree426e86437c8417b7cf115e4689c4860403e9aad7 /src
parent78e88f46d60c5487946fc7632a7561bdff6b9fcc (diff)
downloadrust-3fd15c8404626c6622555e66299c9f3442bf2322.tar.gz
rust-3fd15c8404626c6622555e66299c9f3442bf2322.zip
Refer to uninferred `const` params by their name, instead of `{ _: _ }`
When the value of a const param isn't inferred, replace it with the
param name from the definition.
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/const-generics/defaults/doesnt_infer.stderr2
-rw-r--r--src/test/ui/inference/issue-83606.stderr2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/test/ui/const-generics/defaults/doesnt_infer.stderr b/src/test/ui/const-generics/defaults/doesnt_infer.stderr
index 183be1b1517..10cd491b480 100644
--- a/src/test/ui/const-generics/defaults/doesnt_infer.stderr
+++ b/src/test/ui/const-generics/defaults/doesnt_infer.stderr
@@ -4,7 +4,7 @@ error[E0282]: type annotations needed for `Foo<{_: u32}>`
 LL |     let foo = Foo::foo();
    |         ---   ^^^^^^^^ cannot infer the value of const parameter `N`
    |         |
-   |         consider giving `foo` the explicit type `Foo<{_: _}>`, where the type parameter `N` is specified
+   |         consider giving `foo` the explicit type `Foo<N>`, where the type parameter `N` is specified
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/inference/issue-83606.stderr b/src/test/ui/inference/issue-83606.stderr
index c66606b9c83..0746b2491fb 100644
--- a/src/test/ui/inference/issue-83606.stderr
+++ b/src/test/ui/inference/issue-83606.stderr
@@ -4,7 +4,7 @@ error[E0282]: type annotations needed for `[usize; _]`
 LL |     let _ = foo("foo"); //<- Do not suggest `foo::<N>("foo");`!
    |         -   ^^^ cannot infer the value of const parameter `N` declared on the function `foo`
    |         |
-   |         consider giving this pattern the explicit type `[_; _]`, where the type parameter `N` is specified
+   |         consider giving this pattern the explicit type `[_; N]`, where the type parameter `N` is specified
 
 error: aborting due to previous error