rust/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr
2023-07-27 15:51:02 +00:00

22 lines
770 B
Plaintext

error[E0080]: evaluation of constant value failed
--> $SRC_DIR/core/src/ops/function.rs:LL:COL
|
= note: calling non-const function `<() as Tr>::a`
|
note: inside `<fn(()) -> i32 {<() as Tr>::a} as FnOnce<((),)>>::call_once - shim(fn(()) -> i32 {<() as Tr>::a})`
--> $SRC_DIR/core/src/ops/function.rs:LL:COL
note: inside `need_const_closure::<fn(()) -> i32 {<() as Tr>::a}>`
--> $DIR/const-closure-trait-method-fail.rs:15:5
|
LL | x(())
| ^^^^^
note: inside `_`
--> $DIR/const-closure-trait-method-fail.rs:18:23
|
LL | const _: () = assert!(need_const_closure(Tr::a) == 42);
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0080`.