You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.
use failure::Error;fnmain() -> Result<(),Error>{let success:Result<(), !> = Ok(());
success?;Ok(())}
error[E0277]: the trait bound `(): std::error::Error` is not satisfied
--> src/main.rs:8:12
|
8 | success?;
| ^ the trait `std::error::Error` is not implemented for `()`
|
= note: required because of the requirements on the impl of `failure::Fail` for `()`
= note: required because of the requirements on the impl of `std::convert::From<()>` for `failure::error::Error`
= note: required by `std::convert::From::from`
It can be made to compile by mapping the error type:
... but that results in a warning for unreachable code, since the error type is !.
Is there a workaround for this? Right now I'm calling unwrap(), and I put some explicit type annotations so if the error type ever changes, It'll fail to compile.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The following fails to compile:
It can be made to compile by mapping the error type:
... but that results in a warning for unreachable code, since the error type is
!
.Is there a workaround for this? Right now I'm calling
unwrap()
, and I put some explicit type annotations so if the error type ever changes, It'll fail to compile.The text was updated successfully, but these errors were encountered: