error_mancer 0.4.3

Quickly define custom error enums for a function.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
error[E0277]: Error `std::io::Error` not allowed to be returned from this function.
 --> tests/ui/no_errors_anyhow.rs:6:45
  |
6 |     let _ = std::fs::File::open("hello.txt")?;
  |                                             ^ `std::io::Error` is not listed in `#[errors]` attribute
  |
  = help: the trait `ErrorMancerFrom<std::io::Error>` is not implemented for `FooError`
  = note: Add `std::io::Error` to `#[errors]` attribute or handle this error locally.
  = help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>`
note: required for `FooError` to implement `From<std::io::Error>`
 --> tests/ui/no_errors_anyhow.rs:4:1
  |
4 | #[errors]
  | ^^^^^^^^^
  = note: required for `Result<i32, FooError>` to implement `FromResidual<Result<Infallible, std::io::Error>>`
  = note: this error originates in the attribute macro `errors` (in Nightly builds, run with -Z macro-backtrace for more info)