Skip to content

cargo check --tests fails to compile macros in examples #5397

@kornelski

Description

@kornelski

Running cargo check --tests on https://github.com/nickel-org/nickel.rs unexpectedly can't find macros. However, cargo test --all compiles fine.

warning: unused #[macro_use] import
--> examples/https.rs:1:1
|
1 | #[macro_use] extern crate nickel;
| ^^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default

error: cannot find macro middleware! in this scope
--> examples/integration_testing.rs:90:22
|
90 | server.post("/", middleware! { |req, res|
| ^^^^^^^^^^

error: cannot find macro lazy_static! in this scope
--> examples/integration_testing.rs:279:9
|
279 | lazy_static! {
| ^^^^^^^^^^^

  • cargo check --tests fails to compile examples
  • cargo check --examples does compile examples, but with warnings
  • cargo build --examples compiles examples without warnings

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions