Skip to content

New version (0.3.48) makes my project stop compiling #783

Description

@nicopap

Edit from @jhpratt:

Do not make "me too" comments. They add nothing of value and will only mean it takes longer for me to release a patch, as it's more I have to read. I am aware of the issue and the downstream breakage. A patch will be issued as soon as I am able.

Original issue follows.


Since updating the time crate from 0.3.47 to 0.3.48, my crate stop compiling with the following error message:

error[E0119]: conflicting implementations of trait `From<format_description::parse::format_item::HourBase>` for type `<format_description::parse::format_item::HourBase as format_description::parse::format_item::ModifierValue>::Type`
   --> .../tracing-subscriber-0.3.23/src/filter/env/mod.rs:759:1
    |
759 | / impl<S> From<S> for EnvFilter
760 | | where
761 | |     S: AsRef<str>,
    | |__________________^
    |
    = note: conflicting implementation in crate `time`:
            - impl From<format_description::parse::format_item::HourBase> for <format_description::parse::format_item::HourBase as format_description::parse::format_item::ModifierValue>::Type;
    = note: upstream crates may add a new impl of trait `core::convert::AsRef<str>` for type `time::format_description::parse::format_item::HourBase` in future versions

Not sure if it is the time crate responsibility or tracing_subscriber 🙈

I'm not sure what's going on. HourBase is a private type. May be a compiler bug?

Tested with cargo v1.90.0, nightly 1.98.0 (2026-06-11) and nightly 1.96.0 ( 2026-03-19)

Workaround

As mentioned in the thread, in your Cargo.toml, pin the time dependency:

-time = "0.3.47"
+time = "=0.3.47"

If time is a transitive dependency, then add the + line to your Cargo.toml. It's recommended to revert to unpinned dependency once the fix is in.

Please don't do this if your crate is a library upon which 3rd parties rely (🙏). It will likely result in duplicate time deps, and further compilation issues caused by incompatible same-crate types.

Pinned by jhpratt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions