We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The code below does not compile:
use error_stack::Result; use libp2p::{gossipsub, swarm::NetworkBehaviour}; #[derive(NetworkBehaviour)] struct MyBehaviour { gossipsub: gossipsub::Behaviour, } fn main() { println!("Hello, world!"); }
This happens because use error_stack::Result; redefines Result and the code generated by the macro #[derive(NetworkBehaviour)] becomes invalid.
use error_stack::Result;
Result
#[derive(NetworkBehaviour)]
The code should compile.
The code does not compile.
error[E0308]: mismatched types --> src\main.rs:4:10 | 4 | #[derive(NetworkBehaviour)] | ^^^^^^^^^^^^^^^^ | | | expected `Result<(), ...>`, found `Result<(), Error>` | expected `Result<(), error_stack::Report<std::fmt::Error>>` because of return type | = note: expected enum `Result<_, error_stack::Report<std::fmt::Error>>` found enum `Result<_, std::fmt::Error>`
Replace the Result in the ./swarm-derive/src/lib.rs file with std::result::Result.
./swarm-derive/src/lib.rs
std::result::Result
master, commit: 3ce976d8b7f7e2e636cc09844f81a88ee33d780a
master
3ce976d8b7f7e2e636cc09844f81a88ee33d780a
Yes
The text was updated successfully, but these errors were encountered:
Sounds good, a PR would be appreciated!
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Summary
The code below does not compile:
This happens because
use error_stack::Result;
redefinesResult
and the code generated by the macro#[derive(NetworkBehaviour)]
becomes invalid.Expected behavior
The code should compile.
Actual behavior
The code does not compile.
Relevant log output
Possible Solution
Replace the
Result
in the./swarm-derive/src/lib.rs
file withstd::result::Result
.Version
master
, commit:3ce976d8b7f7e2e636cc09844f81a88ee33d780a
Would you like to work on fixing this bug?
Yes
The text was updated successfully, but these errors were encountered: