You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New version (0.3.48) makes my project stop compiling #783
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.
rustup --version
rustup 1.29.0 (28d1352db 2026-03-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: the currently active `rustc` version is `rustc 1.96.0 (ac68faa20 2026-05-25)`
Workaround:
cargo update -p time --precise 0.3.47
Reacted by Alien Science, Marenga, oooo-ps and Richard Hess
IMO, the issue is in the downstream crates implementing generic From conversions. These are are always footguns due to Rust's model. tracing_subscriber should implement From<&str> instead of From<S>. cookie should implement From<Option<OffsetDateTime>> instead of From<T>, and so on.
Anything made in this crate will be just workarounds. The crates with generic conversions should fix their code and get rid of these conversions.
@demurgos That's fair, but I also think this release of time should have had a minor version bump (0.4.0 instead of 0.3.48) to avoid breakage for a lot of projects that employ the "best practice" of relying on Cargo's freewheeling automatic upgrades. (By the way, I'm sure it wasn't intentional! Mistakes happen.)
I created a minimize branch where I'm working on providing the smallest code snippet triggering this problem. Right now (demurgos/time-783@8cbb166) I was able to include the relevant code from aws-smithy-types and time into the repo so everything is self-contained to trigger the issue.
From the previous self-contained reproduction, I minimized it to only two single-file crates exhibiting the issue. Still on my minimize branch, at commit demurgos/time-783@1234eff.
$ cargo +stable check
Checking aws-smithy-types v1.4.9 (/data/projects/various/time-783/aws-smithy-types)
error[E0119]: conflicting implementations of trait `From<format_item::HourBase>` for type `<format_item::HourBase as format_item::ModifierValue>::Type`
--> src/lib.rs:8:5
|
8 | impl<T> From<T> for CanDisable<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: conflicting implementation in crate `time`:
- impl From<format_item::HourBase> for <format_item::HourBase as format_item::ModifierValue>::Type;
For more information about this error, try `rustc --explain E0119`.
error: could not compile `aws-smithy-types` (lib) due to 1 previous error
Activity
AntoineSebert commentedon Jun 12, 2026
Same issue with different toolchain:
Workaround:
krisztianfekete commentedon Jun 12, 2026
yossy4411 commentedon Jun 12, 2026
alienscience commentedon Jun 12, 2026
fix(ci): pin broken upstream transitive releases
tliron commentedon Jun 12, 2026
Is there a temporary fix?
As far as I can tell, it's impossible to pin versions of indirect dependencies using Cargo.
paolobarbolini commentedon Jun 12, 2026
Temporarily make it into a direct dependency and then you'll be able to pin it.
neunzehn86 commentedon Jun 12, 2026
Pin the version with:
But be careful with simple
cargo update, I'll be the latest again.xlfish233 commentedon Jun 12, 2026
check my pr https://github.com/time-rs/time/pull/784 i had fixed this.
yeoleobun commentedon Jun 12, 2026
jperkin commentedon Jun 12, 2026
Pin time to 0.3.47 to dodge the 0.3.48 coherence regression
longzou commentedon Jun 12, 2026
demurgos commentedon Jun 12, 2026
This also broke the cookie crate: rwf2/cookie-rs#251
IMO, the issue is in the downstream crates implementing generic
Fromconversions. These are are always footguns due to Rust's model.tracing_subscribershould implementFrom<&str>instead ofFrom<S>.cookieshould implementFrom<Option<OffsetDateTime>>instead ofFrom<T>, and so on.Anything made in this crate will be just workarounds. The crates with generic conversions should fix their code and get rid of these conversions.
tliron commentedon Jun 12, 2026
@demurgos That's fair, but I also think this release of
timeshould have had a minor version bump (0.4.0 instead of 0.3.48) to avoid breakage for a lot of projects that employ the "best practice" of relying on Cargo's freewheeling automatic upgrades. (By the way, I'm sure it wasn't intentional! Mistakes happen.)33 remaining items
jhpratt commentedon Jun 13, 2026
Ah, I see. I thought having it in
Cargo.tomlwas sufficient. I'll give that a shot.xlfish233 commentedon Jun 13, 2026
demurgos commentedon Jun 13, 2026
Here is fairly small repo reproducing the problem: https://github.com/demurgos/time-783
demurgos commentedon Jun 13, 2026
I created a
minimizebranch where I'm working on providing the smallest code snippet triggering this problem. Right now (demurgos/time-783@8cbb166) I was able to include the relevant code fromaws-smithy-typesandtimeinto the repo so everything is self-contained to trigger the issue.demurgos commentedon Jun 13, 2026
From the previous self-contained reproduction, I minimized it to only two single-file crates exhibiting the issue. Still on my
minimizebranch, at commit demurgos/time-783@1234eff../aws-smithy-types/src/lib.rs:./time/src/lib.rs:Running
cargo checkinside./aws-smithy-typesproduces:demurgos commentedon Jun 13, 2026
It was identified as a Rustc bug: rust-lang/rust#85898. see in the PR thread: #786 (comment)
fix: pin time to 0.3.47 to avoid E0119 regression in time 0.3.48 (tim…
Update deps except for time
jhpratt commentedon Jun 13, 2026
Patch is on
mainand will be released shortly.tliron commentedon Jun 13, 2026
Many thanks to @jhpratt for the investigation and quick response. Yesterday was stressful!
jhpratt commentedon Jun 13, 2026
CI is green and it has now been released. Hopefully no more issues 🤞
Use READ COMMITTED isolation for migration backfill queries (#4495)
fix(deps): relax time bound to 0.3.55 (coherence bug fixed upstream)
chore(deps): unpin time and bump to 0.3.55 (#1220)