Dear all,
I have a crate like this:
src/
├── ast
│ └── mod.rs
├── compiler
│ ├── cgenerator.rs
│ ├── constraints.rs
│ ├── declarations.rs
│ ├── evaluate.rs
│ ├── expression.rs
│ ├── lipid_database.rs
│ ├── ltl_generator.rs
│ ├── mod.rs
│ ├── options.rs
│ ├── report.rs
│ └── utils.rs
├── grammar-bnf.txt
├── grammar.lalrpop
├── grammar.rs
├── grammar.rs.bk
├── lib.rs
├── main.rs
├── parser.rs
├── tests.rs
└── tok
├── lexer.rs
├── lexer.rs.bk
└── mod.rs
In ltl_generator.rs
I have a test module in which I like to call a macro I defined in utils.rs
:
#[cfg(test)]
mod test {
#[test]
ltl_test() {
#[macro_use] use compiler::utils;
...
}
}
The macro is included in compiler/mod.rs
:
#[macro_use] pub mod utils;
However, cargo test
tells me:
$ cargo test compiler::ltl_generator::test::ltl_generation -- --nocapture
Compiling mfql v0.1.0 (file:///home/herzog/Lipotype/ltx2/backend/mfql)
error: cannot find macro `candidate!` in this scope
--> compiler/ltl_generator.rs:86:25
|
86 | let candidate = candidate!(ast::DeclKind::Intact,
| ^^^^^^^^^
|
= help: have you added the `#[macro_use]` on the module/import?
error: aborting due to previous error(s)
error: Could not compile `mfql`.
I don't know what is wrong here. Any help is appreciated.
Ronny