when I compile the crate with cargo build --features my_error, there is no error. But when I compile with cargo build, the error is as follows:
error[E0433]: failed to resolve: maybe a missing crate `my_error`?
--> src/main.rs:21:28
|
21 | MyError(super::my_error::errors::Error, super::my_error::errors::ErrorKind);
| ^^^^^^^^ maybe a missing crate `my_error`?
error[E0433]: failed to resolve: maybe a missing crate `my_error`?
--> src/main.rs:21:60
|
21 | MyError(super::my_error::errors::Error, super::my_error::errors::ErrorKind);
| ^^^^^^^^ maybe a missing crate `my_error`?
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0433`.
error: could not compile `error_chain_feature`.
I want to keep using the my_error feature, but how could I fix the problem?
Hello, I have a question about the usage of error_chain.
I have a sub-module which is featured by
my_error
, and I need to link it to the upper module'serror_chain!
macro.The following is my code:
And the relevant content in Cargo.toml:
when I compile the crate with
cargo build --features my_error
, there is no error. But when I compile withcargo build
, the error is as follows:I want to keep using the
my_error
feature, but how could I fix the problem?Thanks for your response!