about summary refs log tree commit diff
path: root/tests/ui/const-generics/generic_const_exprs
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2024-06-30 17:08:45 +0000
committerDeadbeef <ent3rm4n@gmail.com>2024-06-30 17:08:45 +0000
commitdaff015314b9ffeb2f65fa45659a1c3008149534 (patch)
treeebc6550fb2ac73275530812d7c340d9f528a3589 /tests/ui/const-generics/generic_const_exprs
parent34ae56de35d4c8b61f51758113debea2ec7c21e7 (diff)
downloadrust-daff015314b9ffeb2f65fa45659a1c3008149534.tar.gz
rust-daff015314b9ffeb2f65fa45659a1c3008149534.zip
Migrate tests to use `-Znext-solver`
Diffstat (limited to 'tests/ui/const-generics/generic_const_exprs')
-rw-r--r--tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.rs2
-rw-r--r--tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr32
2 files changed, 24 insertions, 10 deletions
diff --git a/tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.rs b/tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.rs
index bd9c08e5ad8..818b5d6ca93 100644
--- a/tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.rs
+++ b/tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.rs
@@ -1,5 +1,5 @@
 //@ known-bug: #110395
-
+//@ compile-flags: -Znext-solver
 #![feature(generic_const_exprs, adt_const_params, const_trait_impl, effects)]
 #![allow(incomplete_features)]
 
diff --git a/tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr b/tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr
index cf03bb9ad76..db93bcca60f 100644
--- a/tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr
@@ -19,6 +19,12 @@ LL + #[derive(ConstParamTy)]
 LL | struct Foo(u8);
    |
 
+error[E0284]: type annotations needed: cannot normalize `foo<N>::{constant#0}`
+  --> $DIR/unify-op-with-fn-call.rs:20:25
+   |
+LL | fn foo<const N: Foo>(a: Evaluatable<{ N + N }>) {
+   |                         ^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo<N>::{constant#0}`
+
 error[E0741]: `Foo` must implement `ConstParamTy` to be used as the type of a const generic parameter
   --> $DIR/unify-op-with-fn-call.rs:20:17
    |
@@ -43,17 +49,25 @@ LL + #[derive(ConstParamTy)]
 LL | struct Foo(u8);
    |
 
-error: unconstrained generic constant
-  --> $DIR/unify-op-with-fn-call.rs:30:12
+error[E0284]: type annotations needed: cannot normalize `foo2<N>::{constant#0}`
+  --> $DIR/unify-op-with-fn-call.rs:29:28
    |
-LL |     bar2::<{ std::ops::Add::add(N, N) }>();
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | fn foo2<const N: usize>(a: Evaluatable2<{ N + N }>) {
+   |                            ^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo2<N>::{constant#0}`
+
+error[E0284]: type annotations needed: cannot normalize `foo<N>::{constant#0}`
+  --> $DIR/unify-op-with-fn-call.rs:21:11
    |
-help: try adding a `where` bound
+LL |     bar::<{ std::ops::Add::add(N, N) }>();
+   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo<N>::{constant#0}`
+
+error[E0284]: type annotations needed: cannot normalize `foo2<N>::{constant#0}`
+  --> $DIR/unify-op-with-fn-call.rs:30:12
    |
-LL | fn foo2<const N: usize>(a: Evaluatable2<{ N + N }>) where [(); { std::ops::Add::add(N, N) }]: {
-   |                                                     +++++++++++++++++++++++++++++++++++++++++
+LL |     bar2::<{ std::ops::Add::add(N, N) }>();
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo2<N>::{constant#0}`
 
-error: aborting due to 5 previous errors
+error: aborting due to 8 previous errors
 
-For more information about this error, try `rustc --explain E0741`.
+Some errors have detailed explanations: E0284, E0741.
+For more information about an error, try `rustc --explain E0284`.