]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr
Auto merge of #106371 - RalfJung:no-ret-position-noalias, r=nikic
[rust.git] / src / test / ui / rfc-2632-const-trait-impl / const-closure-trait-method-fail.stderr
1 error[E0277]: the trait bound `(): ~const Tr` is not satisfied in `fn(()) -> i32 {<() as Tr>::a}`
2   --> $DIR/const-closure-trait-method-fail.rs:16:42
3    |
4 LL | const _: () = assert!(need_const_closure(Tr::a) == 42);
5    |                       ------------------ ^^^^^ within `fn(()) -> i32 {<() as Tr>::a}`, the trait `~const Tr` is not implemented for `()`
6    |                       |
7    |                       required by a bound introduced by this call
8    |
9 note: the trait `Tr` is implemented for `()`, but that implementation is not `const`
10   --> $DIR/const-closure-trait-method-fail.rs:16:42
11    |
12 LL | const _: () = assert!(need_const_closure(Tr::a) == 42);
13    |                                          ^^^^^
14    = note: required because it appears within the type `fn(()) -> i32 {<() as Tr>::a}`
15 note: required by a bound in `need_const_closure`
16   --> $DIR/const-closure-trait-method-fail.rs:12:32
17    |
18 LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32>(x: T) -> i32 {
19    |                                ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `need_const_closure`
20
21 error: aborting due to previous error
22
23 For more information about this error, try `rustc --explain E0277`.