about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/const_eval_resolve_canonical.rs1
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/const_eval_resolve_canonical.stderr28
-rw-r--r--src/test/ui/const-generics/issues/issue-83249.stderr15
3 files changed, 29 insertions, 15 deletions
diff --git a/src/test/ui/const-generics/generic_const_exprs/const_eval_resolve_canonical.rs b/src/test/ui/const-generics/generic_const_exprs/const_eval_resolve_canonical.rs
index bcb3e83b73a..18f33acaabb 100644
--- a/src/test/ui/const-generics/generic_const_exprs/const_eval_resolve_canonical.rs
+++ b/src/test/ui/const-generics/generic_const_exprs/const_eval_resolve_canonical.rs
@@ -27,4 +27,5 @@ fn main() {
     //~^ ERROR type annotations needed
 
     _q = foo::<_, 2>(_q);
+    //~^ ERROR type annotations needed
 }
diff --git a/src/test/ui/const-generics/generic_const_exprs/const_eval_resolve_canonical.stderr b/src/test/ui/const-generics/generic_const_exprs/const_eval_resolve_canonical.stderr
index 75bca058e7c..e59f1ac8027 100644
--- a/src/test/ui/const-generics/generic_const_exprs/const_eval_resolve_canonical.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/const_eval_resolve_canonical.stderr
@@ -4,6 +4,30 @@ error[E0282]: type annotations needed
 LL |     let mut _q = Default::default();
    |         ^^^^^^ consider giving `_q` a type
 
-error: aborting due to previous error
+error[E0283]: type annotations needed
+  --> $DIR/const_eval_resolve_canonical.rs:29:10
+   |
+LL |     _q = foo::<_, 2>(_q);
+   |          ^^^^^^^^^^^ cannot infer type
+   |
+note: multiple `impl`s satisfying `(): Foo<{ N + 1 }>` found
+  --> $DIR/const_eval_resolve_canonical.rs:8:1
+   |
+LL | impl Foo<0> for () {
+   | ^^^^^^^^^^^^^^^^^^
+...
+LL | impl Foo<3> for () {
+   | ^^^^^^^^^^^^^^^^^^
+note: required by a bound in `foo`
+  --> $DIR/const_eval_resolve_canonical.rs:18:9
+   |
+LL | fn foo<T, const N: usize>(_: T) -> <() as Foo<{ N + 1 }>>::Assoc
+   |    --- required by a bound in this
+LL | where
+LL |     (): Foo<{ N + 1 }>,
+   |         ^^^^^^^^^^^^^^ required by this bound in `foo`
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0282`.
+Some errors have detailed explanations: E0282, E0283.
+For more information about an error, try `rustc --explain E0282`.
diff --git a/src/test/ui/const-generics/issues/issue-83249.stderr b/src/test/ui/const-generics/issues/issue-83249.stderr
index 13914134eb2..402b3aa2d61 100644
--- a/src/test/ui/const-generics/issues/issue-83249.stderr
+++ b/src/test/ui/const-generics/issues/issue-83249.stderr
@@ -1,22 +1,11 @@
-error[E0283]: type annotations needed
+error[E0282]: type annotations needed
   --> $DIR/issue-83249.rs:19:13
    |
 LL |     let _ = foo([0; 1]);
    |         -   ^^^ cannot infer type for type parameter `T` declared on the function `foo`
    |         |
    |         consider giving this pattern a type
-   |
-   = note: cannot satisfy `_: Foo`
-note: required by a bound in `foo`
-  --> $DIR/issue-83249.rs:12:11
-   |
-LL | fn foo<T: Foo>(_: [u8; T::N]) -> T {
-   |           ^^^ required by this bound in `foo`
-help: consider specifying the type argument in the function call
-   |
-LL |     let _ = foo::<T>([0; 1]);
-   |                +++++
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0283`.
+For more information about this error, try `rustc --explain E0282`.