mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
![]() ``` error[E0271]: expected `{closure@return-type-doesnt-match-bound.rs:18:13}` to be a closure that returns `Result<(), _>`, but it returns `!` --> tests/ui/closures/return-type-doesnt-match-bound.rs:18:20 | 18 | let c = |e| -> ! { //~ ERROR to be a closure that returns | -------^ | | | expected `Result<(), _>`, found `!` ... 22 | f().or_else(c); | ------- - | | | required by a bound introduced by this call | = note: expected enum `Result<(), _>` found type `!` note: required by a bound in `Result::<T, E>::or_else` --> /home/gh-estebank/rust/library/core/src/result.rs:1406:39 | 1406 | pub fn or_else<F, O: FnOnce(E) -> Result<T, F>>(self, op: O) -> Result<T, F> { | ^^^^^^^^^^^^ required by this bound in `Result::<T, E>::or_else` ``` |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
messages.ftl |