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
The following project won't compile unless the sha2 dependency is removed or changed to version "0.5.3" instead (remove Cargo.lock & target/ before recompiling).
Cargo.toml
[package]
name = "postgres_chrono_test"version = "0.1.0"
[dependencies]
postgres = { version = "*", features = ["with-chrono"] }
chrono = "*"sha2 = "0.6.0"
src/main.rs
externcrate chrono;externcrate postgres;fnmain(){let conn = postgres::Connection::connect("postgres://test@localhost:5432", postgres::TlsMode::None).unwrap();for row in&conn.query("SELECT foo FROM widgets WHERE bar = 1",&[]).unwrap(){let _: chrono::NaiveDateTime = row.get(0);}}
$ cargo check
error[E0277]: the trait bound `chrono::NaiveDateTime: postgres::types::FromSql` is not satisfied
--> src/main.rs:6:44
|
6 | let _: chrono::NaiveDateTime = row.get(0);
| ^^^ the trait `postgres::types::FromSql` is not implemented for `chrono::NaiveDateTime`
I'm not sure what's going on here, if I hit a basic limitation of Rust when multiple versions of the same crate are pulled in or if this is specific to the postgres crate. Any explanation would be much appreciated.
The text was updated successfully, but these errors were encountered:
The wildcard version constraints on postgres and chrono state that your crate works with every version of postgres and chrono that have ever been released. Cargo is selecting postgres 0.14.1 and chrono 0.4 which aren't compatible.
If you select the versions of postgres and chrono you actually want, it seems like it runs into rust-lang/cargo#4488. :(
The wildcard version constraints on postgres and chrono state that your crate works with every version of postgres and chrono that have ever been released.
Well, I did not know that. Turns out I totally misunderstood wildcard versions. Thanks for the explanation.
The following project won't compile unless the sha2 dependency is removed or changed to version "0.5.3" instead (remove
Cargo.lock
&target/
before recompiling).Cargo.toml
src/main.rs
$ cargo check
I'm not sure what's going on here, if I hit a basic limitation of Rust when multiple versions of the same crate are pulled in or if this is specific to the postgres crate. Any explanation would be much appreciated.
The text was updated successfully, but these errors were encountered: