summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr')
-rw-r--r--tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr b/tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr
new file mode 100644
index 000000000..4470e287c
--- /dev/null
+++ b/tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr
@@ -0,0 +1,23 @@
+error[E0277]: the trait bound `(): ~const Tr` is not satisfied in `fn(()) -> i32 {<() as Tr>::a}`
+ --> $DIR/const-closure-trait-method-fail.rs:16:42
+ |
+LL | const _: () = assert!(need_const_closure(Tr::a) == 42);
+ | ------------------ ^^^^^ within `fn(()) -> i32 {<() as Tr>::a}`, the trait `~const Tr` is not implemented for `()`
+ | |
+ | required by a bound introduced by this call
+ |
+note: the trait `Tr` is implemented for `()`, but that implementation is not `const`
+ --> $DIR/const-closure-trait-method-fail.rs:16:42
+ |
+LL | const _: () = assert!(need_const_closure(Tr::a) == 42);
+ | ^^^^^
+ = note: required because it appears within the type `fn(()) -> i32 {<() as Tr>::a}`
+note: required by a bound in `need_const_closure`
+ --> $DIR/const-closure-trait-method-fail.rs:12:32
+ |
+LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32>(x: T) -> i32 {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `need_const_closure`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.