I have a module with a name macros.rsthat contains
/// Macro to easily implement FromError.
/// from_error!(MyError, IoError, MyError::IoError)
macro_rules! from_error {
( $t:ty, $err:ty, $name:path ) => {
use std;
impl std::error::FromError<$err> for $t {
fn from_error(err: $err) -> $t {
$name(err)
}
}
}
}
In my main.rsI import the module as follows
When I try to use from_errorin other modules of my project, the compiler says error: macro undefined: 'from_error!'.
SBSTP source
share