about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/consts/fn_trait_refs.stderr175
-rw-r--r--tests/ui/consts/unstable-const-fn-in-libcore.stderr32
-rw-r--r--tests/ui/impl-trait/normalize-tait-in-const.stderr32
-rw-r--r--tests/ui/intrinsics/const-eval-select-bad.rs7
-rw-r--r--tests/ui/intrinsics/const-eval-select-bad.stderr58
-rw-r--r--tests/ui/traits/const-traits/call.rs2
-rw-r--r--tests/ui/traits/const-traits/call.stderr7
-rw-r--r--tests/ui/traits/const-traits/const-closure-parse-not-item.stderr32
-rw-r--r--tests/ui/traits/const-traits/const-closure-trait-method-fail.stderr33
-rw-r--r--tests/ui/traits/const-traits/const-closure-trait-method.rs5
-rw-r--r--tests/ui/traits/const-traits/const-closure-trait-method.stderr30
-rw-r--r--tests/ui/traits/const-traits/const-closures.rs5
-rw-r--r--tests/ui/traits/const-traits/const-closures.stderr103
-rw-r--r--tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs5
-rw-r--r--tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.stderr12
-rw-r--r--tests/ui/traits/const-traits/ice-112822-expected-type-for-param.rs6
-rw-r--r--tests/ui/traits/const-traits/ice-112822-expected-type-for-param.stderr46
-rw-r--r--tests/ui/traits/const-traits/ice-123664-unexpected-bound-var.rs8
-rw-r--r--tests/ui/traits/const-traits/ice-123664-unexpected-bound-var.stderr21
-rw-r--r--tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.rs2
-rw-r--r--tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.stderr10
21 files changed, 69 insertions, 562 deletions
diff --git a/tests/ui/consts/fn_trait_refs.stderr b/tests/ui/consts/fn_trait_refs.stderr
index 445dd75f824..bbe0714801c 100644
--- a/tests/ui/consts/fn_trait_refs.stderr
+++ b/tests/ui/consts/fn_trait_refs.stderr
@@ -4,151 +4,6 @@ error[E0635]: unknown feature `const_fn_trait_ref_impls`
 LL | #![feature(const_fn_trait_ref_impls)]
    |            ^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/fn_trait_refs.rs:14:8
-   |
-LL |     T: [const] Fn<()> + [const] Destruct,
-   |        ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/fn_trait_refs.rs:14:8
-   |
-LL |     T: [const] Fn<()> + [const] Destruct,
-   |        ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/fn_trait_refs.rs:14:8
-   |
-LL |     T: [const] Fn<()> + [const] Destruct,
-   |        ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/fn_trait_refs.rs:21:8
-   |
-LL |     T: [const] FnMut<()> + [const] Destruct,
-   |        ^^^^^^^ can't be applied to `FnMut`
-   |
-note: `FnMut` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/fn_trait_refs.rs:21:8
-   |
-LL |     T: [const] FnMut<()> + [const] Destruct,
-   |        ^^^^^^^ can't be applied to `FnMut`
-   |
-note: `FnMut` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/fn_trait_refs.rs:21:8
-   |
-LL |     T: [const] FnMut<()> + [const] Destruct,
-   |        ^^^^^^^ can't be applied to `FnMut`
-   |
-note: `FnMut` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/fn_trait_refs.rs:28:8
-   |
-LL |     T: [const] FnOnce<()>,
-   |        ^^^^^^^ can't be applied to `FnOnce`
-   |
-note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/fn_trait_refs.rs:28:8
-   |
-LL |     T: [const] FnOnce<()>,
-   |        ^^^^^^^ can't be applied to `FnOnce`
-   |
-note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/fn_trait_refs.rs:28:8
-   |
-LL |     T: [const] FnOnce<()>,
-   |        ^^^^^^^ can't be applied to `FnOnce`
-   |
-note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/fn_trait_refs.rs:35:8
-   |
-LL |     T: [const] Fn<()> + [const] Destruct,
-   |        ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/fn_trait_refs.rs:35:8
-   |
-LL |     T: [const] Fn<()> + [const] Destruct,
-   |        ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/fn_trait_refs.rs:35:8
-   |
-LL |     T: [const] Fn<()> + [const] Destruct,
-   |        ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/fn_trait_refs.rs:49:8
-   |
-LL |     T: [const] FnMut<()> + [const] Destruct,
-   |        ^^^^^^^ can't be applied to `FnMut`
-   |
-note: `FnMut` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/fn_trait_refs.rs:49:8
-   |
-LL |     T: [const] FnMut<()> + [const] Destruct,
-   |        ^^^^^^^ can't be applied to `FnMut`
-   |
-note: `FnMut` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/fn_trait_refs.rs:49:8
-   |
-LL |     T: [const] FnMut<()> + [const] Destruct,
-   |        ^^^^^^^ can't be applied to `FnMut`
-   |
-note: `FnMut` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
 error[E0277]: the trait bound `(i32, i32, i32): const PartialEq` is not satisfied
   --> $DIR/fn_trait_refs.rs:71:17
    |
@@ -161,31 +16,7 @@ error[E0277]: the trait bound `(i32, i32): const PartialEq` is not satisfied
 LL |         assert!(test_two == (2, 2));
    |                 ^^^^^^^^^^^^^^^^^^
 
-error[E0015]: cannot call non-const closure in constant functions
-  --> $DIR/fn_trait_refs.rs:16:5
-   |
-LL |     f()
-   |     ^^^
-   |
-   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-
-error[E0015]: cannot call non-const closure in constant functions
-  --> $DIR/fn_trait_refs.rs:23:5
-   |
-LL |     f()
-   |     ^^^
-   |
-   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-
-error[E0015]: cannot call non-const closure in constant functions
-  --> $DIR/fn_trait_refs.rs:30:5
-   |
-LL |     f()
-   |     ^^^
-   |
-   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-
-error: aborting due to 21 previous errors
+error: aborting due to 3 previous errors
 
-Some errors have detailed explanations: E0015, E0277, E0635.
-For more information about an error, try `rustc --explain E0015`.
+Some errors have detailed explanations: E0277, E0635.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/consts/unstable-const-fn-in-libcore.stderr b/tests/ui/consts/unstable-const-fn-in-libcore.stderr
index 95e48b7b7c8..16db7791cd8 100644
--- a/tests/ui/consts/unstable-const-fn-in-libcore.stderr
+++ b/tests/ui/consts/unstable-const-fn-in-libcore.stderr
@@ -1,30 +1,3 @@
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/unstable-const-fn-in-libcore.rs:19:32
-   |
-LL |     const fn unwrap_or_else<F: [const] FnOnce() -> T>(self, f: F) -> T {
-   |                                ^^^^^^^ can't be applied to `FnOnce`
-   |
-note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/unstable-const-fn-in-libcore.rs:19:32
-   |
-LL |     const fn unwrap_or_else<F: [const] FnOnce() -> T>(self, f: F) -> T {
-   |                                ^^^^^^^ can't be applied to `FnOnce`
-   |
-note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0015]: cannot call non-const closure in constant functions
-  --> $DIR/unstable-const-fn-in-libcore.rs:24:26
-   |
-LL |             Opt::None => f(),
-   |                          ^^^
-   |
-   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-
 error[E0493]: destructor of `F` cannot be evaluated at compile-time
   --> $DIR/unstable-const-fn-in-libcore.rs:19:61
    |
@@ -43,7 +16,6 @@ LL |     const fn unwrap_or_else<F: [const] FnOnce() -> T>(self, f: F) -> T {
 LL |     }
    |     - value is dropped here
 
-error: aborting due to 5 previous errors
+error: aborting due to 2 previous errors
 
-Some errors have detailed explanations: E0015, E0493.
-For more information about an error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0493`.
diff --git a/tests/ui/impl-trait/normalize-tait-in-const.stderr b/tests/ui/impl-trait/normalize-tait-in-const.stderr
index e17737d1860..051eb62d9cb 100644
--- a/tests/ui/impl-trait/normalize-tait-in-const.stderr
+++ b/tests/ui/impl-trait/normalize-tait-in-const.stderr
@@ -1,22 +1,3 @@
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/normalize-tait-in-const.rs:27:35
-   |
-LL | const fn with_positive<F: for<'a> [const] Fn(&'a Alias<'a>) + [const] Destruct>(fun: F) {
-   |                                   ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/normalize-tait-in-const.rs:27:35
-   |
-LL | const fn with_positive<F: for<'a> [const] Fn(&'a Alias<'a>) + [const] Destruct>(fun: F) {
-   |                                   ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
 error: unconstrained opaque type
   --> $DIR/normalize-tait-in-const.rs:14:26
    |
@@ -44,15 +25,6 @@ note: this item must have a `#[define_opaque(foo::Alias)]` attribute to be able
 LL |     pub const fn filter_positive<'a>() -> &'a Alias<'a> {
    |                  ^^^^^^^^^^^^^^^
 
-error[E0015]: cannot call non-const closure in constant functions
-  --> $DIR/normalize-tait-in-const.rs:28:5
-   |
-LL |     fun(filter_positive());
-   |     ^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-
-error: aborting due to 5 previous errors
+error: aborting due to 2 previous errors
 
-Some errors have detailed explanations: E0015, E0308.
-For more information about an error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/intrinsics/const-eval-select-bad.rs b/tests/ui/intrinsics/const-eval-select-bad.rs
index 3365d57af7c..f4071251299 100644
--- a/tests/ui/intrinsics/const-eval-select-bad.rs
+++ b/tests/ui/intrinsics/const-eval-select-bad.rs
@@ -5,13 +5,10 @@ use std::intrinsics::const_eval_select;
 
 const fn not_fn_items() {
     const_eval_select((), || {}, || {});
-    //~^ ERROR this argument must be a function item
-    //~| ERROR this argument must be a function item
+    //~^ ERROR const FnOnce()` is not satisfied
     const_eval_select((), 42, 0xDEADBEEF);
     //~^ ERROR expected a `FnOnce()` closure
     //~| ERROR expected a `FnOnce()` closure
-    //~| ERROR this argument must be a function item
-    //~| ERROR this argument must be a function item
 }
 
 const fn foo(n: i32) -> i32 {
@@ -40,7 +37,7 @@ const fn args_ty_mismatch() {
 
 const fn non_const_fn() {
     const_eval_select((1,), bar, bar);
-    //~^ ERROR this argument must be a `const fn`
+    //~^ ERROR the trait bound `fn(i32) -> bool {bar}: const FnOnce(i32)` is not satisfied
 }
 
 fn main() {}
diff --git a/tests/ui/intrinsics/const-eval-select-bad.stderr b/tests/ui/intrinsics/const-eval-select-bad.stderr
index bb159bed282..d701f5ea909 100644
--- a/tests/ui/intrinsics/const-eval-select-bad.stderr
+++ b/tests/ui/intrinsics/const-eval-select-bad.stderr
@@ -1,23 +1,16 @@
-error: this argument must be a function item
+error[E0277]: the trait bound `{closure@$DIR/const-eval-select-bad.rs:7:27: 7:29}: const FnOnce()` is not satisfied
   --> $DIR/const-eval-select-bad.rs:7:27
    |
 LL |     const_eval_select((), || {}, || {});
-   |                           ^^^^^
-   |
-   = note: expected a function item, found {closure@$DIR/const-eval-select-bad.rs:7:27: 7:29}
-   = help: consult the documentation on `const_eval_select` for more information
-
-error: this argument must be a function item
-  --> $DIR/const-eval-select-bad.rs:7:34
-   |
-LL |     const_eval_select((), || {}, || {});
-   |                                  ^^^^^
+   |     -----------------     ^^^^^
+   |     |
+   |     required by a bound introduced by this call
    |
-   = note: expected a function item, found {closure@$DIR/const-eval-select-bad.rs:7:34: 7:36}
-   = help: consult the documentation on `const_eval_select` for more information
+note: required by a bound in `const_eval_select`
+  --> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
 
 error[E0277]: expected a `FnOnce()` closure, found `{integer}`
-  --> $DIR/const-eval-select-bad.rs:10:27
+  --> $DIR/const-eval-select-bad.rs:9:27
    |
 LL |     const_eval_select((), 42, 0xDEADBEEF);
    |     -----------------     ^^ expected an `FnOnce()` closure, found `{integer}`
@@ -30,7 +23,7 @@ note: required by a bound in `const_eval_select`
   --> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
 
 error[E0277]: expected a `FnOnce()` closure, found `{integer}`
-  --> $DIR/const-eval-select-bad.rs:10:31
+  --> $DIR/const-eval-select-bad.rs:9:31
    |
 LL |     const_eval_select((), 42, 0xDEADBEEF);
    |     -----------------         ^^^^^^^^^^ expected an `FnOnce()` closure, found `{integer}`
@@ -42,26 +35,8 @@ LL |     const_eval_select((), 42, 0xDEADBEEF);
 note: required by a bound in `const_eval_select`
   --> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
 
-error: this argument must be a function item
-  --> $DIR/const-eval-select-bad.rs:10:27
-   |
-LL |     const_eval_select((), 42, 0xDEADBEEF);
-   |                           ^^
-   |
-   = note: expected a function item, found {integer}
-   = help: consult the documentation on `const_eval_select` for more information
-
-error: this argument must be a function item
-  --> $DIR/const-eval-select-bad.rs:10:31
-   |
-LL |     const_eval_select((), 42, 0xDEADBEEF);
-   |                               ^^^^^^^^^^
-   |
-   = note: expected a function item, found {integer}
-   = help: consult the documentation on `const_eval_select` for more information
-
 error[E0271]: expected `bar` to return `i32`, but it returns `bool`
-  --> $DIR/const-eval-select-bad.rs:32:34
+  --> $DIR/const-eval-select-bad.rs:29:34
    |
 LL |     const_eval_select((1,), foo, bar);
    |     -----------------            ^^^ expected `i32`, found `bool`
@@ -72,7 +47,7 @@ note: required by a bound in `const_eval_select`
   --> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
 
 error[E0631]: type mismatch in function arguments
-  --> $DIR/const-eval-select-bad.rs:37:32
+  --> $DIR/const-eval-select-bad.rs:34:32
    |
 LL | const fn foo(n: i32) -> i32 {
    | --------------------------- found signature defined here
@@ -91,15 +66,18 @@ help: consider wrapping the function in a closure
 LL |     const_eval_select((true,), |arg0: bool| foo(/* i32 */), baz);
    |                                ++++++++++++    +++++++++++
 
-error: this argument must be a `const fn`
-  --> $DIR/const-eval-select-bad.rs:42:29
+error[E0277]: the trait bound `fn(i32) -> bool {bar}: const FnOnce(i32)` is not satisfied
+  --> $DIR/const-eval-select-bad.rs:39:29
    |
 LL |     const_eval_select((1,), bar, bar);
-   |                             ^^^
+   |     -----------------       ^^^
+   |     |
+   |     required by a bound introduced by this call
    |
-   = help: consult the documentation on `const_eval_select` for more information
+note: required by a bound in `const_eval_select`
+  --> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
 
-error: aborting due to 9 previous errors
+error: aborting due to 6 previous errors
 
 Some errors have detailed explanations: E0271, E0277, E0631.
 For more information about an error, try `rustc --explain E0271`.
diff --git a/tests/ui/traits/const-traits/call.rs b/tests/ui/traits/const-traits/call.rs
index b985e3da345..b1080fe78bb 100644
--- a/tests/ui/traits/const-traits/call.rs
+++ b/tests/ui/traits/const-traits/call.rs
@@ -5,7 +5,7 @@
 
 pub const _: () = {
     assert!((const || true)());
-    //~^ ERROR cannot call non-const closure in constants
+    //~^ ERROR }: [const] Fn()` is not satisfied
 };
 
 fn main() {}
diff --git a/tests/ui/traits/const-traits/call.stderr b/tests/ui/traits/const-traits/call.stderr
index e9bf64092f3..8e32cab6dfc 100644
--- a/tests/ui/traits/const-traits/call.stderr
+++ b/tests/ui/traits/const-traits/call.stderr
@@ -1,12 +1,9 @@
-error[E0015]: cannot call non-const closure in constants
+error[E0277]: the trait bound `{closure@$DIR/call.rs:7:14: 7:22}: [const] Fn()` is not satisfied
   --> $DIR/call.rs:7:13
    |
 LL |     assert!((const || true)());
    |             ^^^^^^^^^^^^^^^^^
-   |
-   = note: closures need an RFC before allowed to be called in constants
-   = note: calls in constants are limited to constant functions, tuple structs and tuple variants
 
 error: aborting due to 1 previous error
 
-For more information about this error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/const-traits/const-closure-parse-not-item.stderr b/tests/ui/traits/const-traits/const-closure-parse-not-item.stderr
index fdfe3b95d55..1d8d5ff1b4f 100644
--- a/tests/ui/traits/const-traits/const-closure-parse-not-item.stderr
+++ b/tests/ui/traits/const-traits/const-closure-parse-not-item.stderr
@@ -1,31 +1,9 @@
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/const-closure-parse-not-item.rs:7:25
+error[E0277]: the trait bound `{closure@$DIR/const-closure-parse-not-item.rs:8:5: 8:18}: [const] Fn()` is not satisfied
+  --> $DIR/const-closure-parse-not-item.rs:7:20
    |
 LL | const fn test() -> impl [const] Fn() {
-   |                         ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/const-closure-parse-not-item.rs:7:25
-   |
-LL | const fn test() -> impl [const] Fn() {
-   |                         ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/const-closure-parse-not-item.rs:7:25
-   |
-LL | const fn test() -> impl [const] Fn() {
-   |                         ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+   |                    ^^^^^^^^^^^^^^^^^
 
-error: aborting due to 3 previous errors
+error: aborting due to 1 previous error
 
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/const-traits/const-closure-trait-method-fail.stderr b/tests/ui/traits/const-traits/const-closure-trait-method-fail.stderr
index 89b202b3438..fddd8d10bcc 100644
--- a/tests/ui/traits/const-traits/const-closure-trait-method-fail.stderr
+++ b/tests/ui/traits/const-traits/const-closure-trait-method-fail.stderr
@@ -1,30 +1,9 @@
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/const-closure-trait-method-fail.rs:14:32
+error[E0277]: the trait bound `(): const Tr` is not satisfied
+  --> $DIR/const-closure-trait-method-fail.rs:18:23
    |
-LL | const fn need_const_closure<T: [const] FnOnce(()) -> i32>(x: T) -> i32 {
-   |                                ^^^^^^^ can't be applied to `FnOnce`
-   |
-note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/const-closure-trait-method-fail.rs:14:32
-   |
-LL | const fn need_const_closure<T: [const] FnOnce(()) -> i32>(x: T) -> i32 {
-   |                                ^^^^^^^ can't be applied to `FnOnce`
-   |
-note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0015]: cannot call non-const closure in constant functions
-  --> $DIR/const-closure-trait-method-fail.rs:15:5
-   |
-LL |     x(())
-   |     ^^^^^
-   |
-   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
+LL | const _: () = assert!(need_const_closure(Tr::a) == 42);
+   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 3 previous errors
+error: aborting due to 1 previous error
 
-For more information about this error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/const-traits/const-closure-trait-method.rs b/tests/ui/traits/const-traits/const-closure-trait-method.rs
index 831d6e27946..6477aa63c68 100644
--- a/tests/ui/traits/const-traits/const-closure-trait-method.rs
+++ b/tests/ui/traits/const-traits/const-closure-trait-method.rs
@@ -1,5 +1,6 @@
-//@ known-bug: #110395
-// FIXME check-pass
+//@ check-pass
+//@ revisions: next old
+//@[next] compile-flags: -Znext-solver
 #![feature(const_trait_impl)]
 
 #[const_trait]
diff --git a/tests/ui/traits/const-traits/const-closure-trait-method.stderr b/tests/ui/traits/const-traits/const-closure-trait-method.stderr
deleted file mode 100644
index 6de25dc11ef..00000000000
--- a/tests/ui/traits/const-traits/const-closure-trait-method.stderr
+++ /dev/null
@@ -1,30 +0,0 @@
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/const-closure-trait-method.rs:14:32
-   |
-LL | const fn need_const_closure<T: [const] FnOnce(()) -> i32>(x: T) -> i32 {
-   |                                ^^^^^^^ can't be applied to `FnOnce`
-   |
-note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/const-closure-trait-method.rs:14:32
-   |
-LL | const fn need_const_closure<T: [const] FnOnce(()) -> i32>(x: T) -> i32 {
-   |                                ^^^^^^^ can't be applied to `FnOnce`
-   |
-note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0015]: cannot call non-const closure in constant functions
-  --> $DIR/const-closure-trait-method.rs:15:5
-   |
-LL |     x(())
-   |     ^^^^^
-   |
-   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/traits/const-traits/const-closures.rs b/tests/ui/traits/const-traits/const-closures.rs
index 2f6f4dc4ba3..8f1c018ca5d 100644
--- a/tests/ui/traits/const-traits/const-closures.rs
+++ b/tests/ui/traits/const-traits/const-closures.rs
@@ -1,5 +1,6 @@
-//@ known-bug: #110395
-// FIXME check-pass
+//@ check-pass
+//@ revisions: next old
+//@[next] compile-flags: -Znext-solver
 
 #![feature(const_trait_impl)]
 
diff --git a/tests/ui/traits/const-traits/const-closures.stderr b/tests/ui/traits/const-traits/const-closures.stderr
deleted file mode 100644
index 19869b47085..00000000000
--- a/tests/ui/traits/const-traits/const-closures.stderr
+++ /dev/null
@@ -1,103 +0,0 @@
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/const-closures.rs:8:12
-   |
-LL |         F: [const] FnOnce() -> u8,
-   |            ^^^^^^^ can't be applied to `FnOnce`
-   |
-note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/const-closures.rs:9:12
-   |
-LL |         F: [const] FnMut() -> u8,
-   |            ^^^^^^^ can't be applied to `FnMut`
-   |
-note: `FnMut` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/const-closures.rs:10:12
-   |
-LL |         F: [const] Fn() -> u8,
-   |            ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/const-closures.rs:8:12
-   |
-LL |         F: [const] FnOnce() -> u8,
-   |            ^^^^^^^ can't be applied to `FnOnce`
-   |
-note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/const-closures.rs:9:12
-   |
-LL |         F: [const] FnMut() -> u8,
-   |            ^^^^^^^ can't be applied to `FnMut`
-   |
-note: `FnMut` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/const-closures.rs:10:12
-   |
-LL |         F: [const] Fn() -> u8,
-   |            ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/const-closures.rs:23:20
-   |
-LL | const fn answer<F: [const] Fn() -> u8>(f: &F) -> u8 {
-   |                    ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/const-closures.rs:23:20
-   |
-LL | const fn answer<F: [const] Fn() -> u8>(f: &F) -> u8 {
-   |                    ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0015]: cannot call non-const closure in constant functions
-  --> $DIR/const-closures.rs:24:5
-   |
-LL |     f() + f()
-   |     ^^^
-   |
-   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-
-error[E0015]: cannot call non-const closure in constant functions
-  --> $DIR/const-closures.rs:24:11
-   |
-LL |     f() + f()
-   |           ^^^
-   |
-   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-
-error[E0015]: cannot call non-const closure in constant functions
-  --> $DIR/const-closures.rs:12:5
-   |
-LL |     f() * 7
-   |     ^^^
-   |
-   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-
-error: aborting due to 11 previous errors
-
-For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs b/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs
index 92427039b43..30002038f68 100644
--- a/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs
+++ b/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs
@@ -1,3 +1,4 @@
+//@ known-bug: #110395
 //@ compile-flags: -Znext-solver
 #![feature(const_closures, const_trait_impl)]
 #![allow(incomplete_features)]
@@ -11,7 +12,7 @@ impl Foo for () {
 }
 
 fn main() {
-    (const || { (()).foo() })();
-    //~^ ERROR: cannot call non-const method `<() as Foo>::foo` in constant functions
+    (const || (()).foo())();
+    // ^ ERROR: cannot call non-const method `<() as Foo>::foo` in constant functions
     // FIXME(const_trait_impl) this should probably say constant closures
 }
diff --git a/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.stderr b/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.stderr
index c08642ba5a3..dab3f14161f 100644
--- a/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.stderr
+++ b/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.stderr
@@ -1,11 +1,9 @@
-error[E0015]: cannot call non-const method `<() as Foo>::foo` in constant functions
-  --> $DIR/const_closure-const_trait_impl-ice-113381.rs:14:22
+error[E0277]: the trait bound `{closure@$DIR/const_closure-const_trait_impl-ice-113381.rs:15:6: 15:14}: [const] Fn()` is not satisfied
+  --> $DIR/const_closure-const_trait_impl-ice-113381.rs:15:5
    |
-LL |     (const || { (()).foo() })();
-   |                      ^^^^^
-   |
-   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
+LL |     (const || (()).foo())();
+   |     ^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 1 previous error
 
-For more information about this error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.rs b/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.rs
index 026f2c0d603..8ee3db445d0 100644
--- a/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.rs
+++ b/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.rs
@@ -1,16 +1,14 @@
 #![feature(const_trait_impl)]
 
 const fn test() -> impl [const] Fn() {
-    //~^ ERROR `[const]` can only be applied to `#[const_trait]` traits
-    //~| ERROR `[const]` can only be applied to `#[const_trait]` traits
-    //~| ERROR `[const]` can only be applied to `#[const_trait]` traits
+    //~^ ERROR: }: [const] Fn()` is not satisfied
     const move || { //~ ERROR const closures are experimental
         let sl: &[u8] = b"foo";
 
         match sl {
             [first, remainder @ ..] => {
                 assert_eq!(first, &b'f');
-                //~^ ERROR cannot call non-const function
+                // FIXME(const_closures) ^ ERROR cannot call non-const function
             }
             [] => panic!(),
         }
diff --git a/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.stderr b/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.stderr
index 78d7b962cc4..abbe0a0070a 100644
--- a/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.stderr
+++ b/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.stderr
@@ -1,5 +1,5 @@
 error[E0658]: const closures are experimental
-  --> $DIR/ice-112822-expected-type-for-param.rs:7:5
+  --> $DIR/ice-112822-expected-type-for-param.rs:5:5
    |
 LL |     const move || {
    |     ^^^^^
@@ -8,45 +8,13 @@ LL |     const move || {
    = help: add `#![feature(const_closures)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/ice-112822-expected-type-for-param.rs:3:25
+error[E0277]: the trait bound `{closure@$DIR/ice-112822-expected-type-for-param.rs:5:5: 5:18}: [const] Fn()` is not satisfied
+  --> $DIR/ice-112822-expected-type-for-param.rs:3:20
    |
 LL | const fn test() -> impl [const] Fn() {
-   |                         ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/ice-112822-expected-type-for-param.rs:3:25
-   |
-LL | const fn test() -> impl [const] Fn() {
-   |                         ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/ice-112822-expected-type-for-param.rs:3:25
-   |
-LL | const fn test() -> impl [const] Fn() {
-   |                         ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0015]: cannot call non-const function `core::panicking::assert_failed::<&u8, &u8>` in constant functions
-  --> $DIR/ice-112822-expected-type-for-param.rs:12:17
-   |
-LL |                 assert_eq!(first, &b'f');
-   |                 ^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-   = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+   |                    ^^^^^^^^^^^^^^^^^
 
-error: aborting due to 5 previous errors
+error: aborting due to 2 previous errors
 
-Some errors have detailed explanations: E0015, E0658.
-For more information about an error, try `rustc --explain E0015`.
+Some errors have detailed explanations: E0277, E0658.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/const-traits/ice-123664-unexpected-bound-var.rs b/tests/ui/traits/const-traits/ice-123664-unexpected-bound-var.rs
deleted file mode 100644
index f1dbd947161..00000000000
--- a/tests/ui/traits/const-traits/ice-123664-unexpected-bound-var.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-#![allow(incomplete_features)]
-#![feature(generic_const_exprs, const_trait_impl)]
-
-const fn with_positive<F: [const] Fn()>() {}
-//~^ ERROR `[const]` can only be applied to `#[const_trait]` traits
-//~| ERROR `[const]` can only be applied to `#[const_trait]` traits
-
-pub fn main() {}
diff --git a/tests/ui/traits/const-traits/ice-123664-unexpected-bound-var.stderr b/tests/ui/traits/const-traits/ice-123664-unexpected-bound-var.stderr
deleted file mode 100644
index 1eccb16b46e..00000000000
--- a/tests/ui/traits/const-traits/ice-123664-unexpected-bound-var.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/ice-123664-unexpected-bound-var.rs:4:27
-   |
-LL | const fn with_positive<F: [const] Fn()>() {}
-   |                           ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-
-error: `[const]` can only be applied to `#[const_trait]` traits
-  --> $DIR/ice-123664-unexpected-bound-var.rs:4:27
-   |
-LL | const fn with_positive<F: [const] Fn()>() {}
-   |                           ^^^^^^^ can't be applied to `Fn`
-   |
-note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
-  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.rs b/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.rs
index fa0f7869644..d0470fa3458 100644
--- a/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.rs
+++ b/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.rs
@@ -11,5 +11,5 @@ impl Foo for () {
 
 fn main() {
     (const || { (()).foo() })();
-    //~^ ERROR: cannot call non-const method
+    //~^ ERROR: }: [const] Fn()` is not satisfied
 }
diff --git a/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.stderr b/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.stderr
index 2d33406c222..dcf65ab6940 100644
--- a/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.stderr
+++ b/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.stderr
@@ -1,11 +1,9 @@
-error[E0015]: cannot call non-const method `<() as Foo>::foo` in constant functions
-  --> $DIR/non-const-op-const-closure-non-const-outer.rs:13:22
+error[E0277]: the trait bound `{closure@$DIR/non-const-op-const-closure-non-const-outer.rs:13:6: 13:14}: [const] Fn()` is not satisfied
+  --> $DIR/non-const-op-const-closure-non-const-outer.rs:13:5
    |
 LL |     (const || { (()).foo() })();
-   |                      ^^^^^
-   |
-   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 1 previous error
 
-For more information about this error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0277`.