galvanic-mock
galvanic-mock copied to clipboard
use_mocks isn't compatible with Rust 2018 uniform paths
The #[use_mocks] macro panics when faced with use statements that use Rust 2018 uniform paths. For example, this code:
#![feature(proc_macro_hygiene)]
struct Foo();
#[cfg(test)]
mod tests {
use galvanic_mock::*;
#[use_mocks]
mod t {
use crate::Foo;
}
}
will fail to build with this error:
error: custom attribute panicked
--> src/lib.rs:8:5
|
8 | #[use_mocks]
| ^^^^^^^^^^^^
|
= help: message: called `Result::unwrap()` on an `Err` value: "failed to parse item: \"mod t {\\n use crate::Foo;\\n}\""
error: aborting due to previous error