Tide: Example code won't build with log = "0.4.14"

Created on 27 Jan 2021  路  4Comments  路  Source: http-rs/tide

just tried to run the "get started" example and it failed to build, with error like

error[E0277]: the trait bound `std::string::String: ToValue` is not satisfied
   --> /home/cli/.cargo/registry/src/github.com-1ecc6299db9ec823/tide-0.15.0/src/listener/failover_listener.rs:112:21
    |
112 | /                     crate::log::info!("unable to bind", {
113 | |                         listener: listener.to_string(),
114 | |                         error: e.to_string()
115 | |                     });
    | |_______________________^ the trait `ToValue` is not implemented for `std::string::String`
    |
    = note: required for the cast to the object type `dyn ToValue`
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

Look like the latest log 0.4.14 which was installed by default causes the problem, have to explicitly specify using the previous version so that it can build

# this works
log = "=0.4.13"

Most helpful comment

Also just ran into this, looks like the problem is that log 0.4.14 moved the implementation of ToValue for String into the kv_unstable_std feature instead of the std feature. I think this counts as an upstream bug?

All 4 comments

Also just ran into this, looks like the problem is that log 0.4.14 moved the implementation of ToValue for String into the kv_unstable_std feature instead of the std feature. I think this counts as an upstream bug?

I also run into this issue in a ci build today. @yoshuawuyts can we lock the version to workaround on the upstream issue?

Thx!

Sounds good. If you can file a PR I can merge + issue a patch release tomorrow morning (a few hours from now)

probably cc/ @kodraus as well

Hi @yoshuawuyts, thanks for the reply. This pr fix this issue. I will resolve the conflicts and ping you there.
Thx!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

friktor picture friktor  路  3Comments

gruberb picture gruberb  路  4Comments

yoshuawuyts picture yoshuawuyts  路  6Comments

alexreg picture alexreg  路  5Comments

milesgranger picture milesgranger  路  6Comments