Skip to content

poem_openapi build fail if time feature is enable, due to missing feature flag at the time crate #1072

@LuckyTurtleDev

Description

@LuckyTurtleDev

Expected Behavior

Build

Actual Behavior

Did not build, if time feature is enable

error[E0432]: unresolved import `time::macros`
  --> /home/lukas/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/poem-openapi-5.1.15/src/types/external/time.rs:7:5
   |
7  |     macros::format_description,
   |     ^^^^^^ could not find `macros` in `time`
   |
note: found an item that was configured out
  --> /home/lukas/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/time-0.3.41/src/lib.rs:97:9
   |
97 | pub mod macros;
   |         ^^^^^^
note: the item is gated behind the `macros` feature
  --> /home/lukas/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/time-0.3.41/src/lib.rs:96:7
   |
96 | #[cfg(feature = "macros")]
   |       ^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0432`.
error: could not compile `poem-openapi` (lib) due to 1 previous error

Steps to Reproduce the Problem

  1. cargo init test_
  2. cd test_/
  3. cargo add [email protected]
  4. cargo add [email protected] --features redoc,time
  5. cargo check

Hint

adding time with features = ["macros"] fix the issue

Specifications

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions