bytecodealliance / bytecodealliance/filecheck

Provide std::error::Error impl for filecheck::Error

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
23
Forks
9
PR merge metrics
No merged PRs in 30d

Description

filecheck::Error does not implement std::error::Error, which makes it unergonomic to use with modern error libraries that rely on that impl for error types.

```rust
use anyhow::Result;

fn f() -> Result<(), filecheck::Error> {
Ok(())
}

fn main() -> Result<()> {
f()?; // doesn't work
Ok(())
}
```

```console
error[E0277]: the trait bound `filecheck::error::Error: std::error::Error` is not satisfied
--> src/main.rs:8:8
|
8 | f()?; // doesn't work
| ^ the trait `std::error::Error` is not implemented for `filecheck::error::Error`
|
= note: required because of the requirements on the impl of `std::convert::From` for `anyhow::Error`
= note: required by `std::convert::From::from
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.