Freyskeyd / environment

6 stars 2 forks source link

impl EnvironmentItem for (OsString, OsString) #14

Open luser opened 6 years ago

luser commented 6 years ago

Currently EnvironmentItem has a blanket impl for (T, T) where T: ToString. Unfortunately this doesn't cover (OsString, OsString), because OsString doesn't impl Display! I ran into this trying to convert some tests I have in sccache to use assert_cli.

luser commented 6 years ago

Unfortunately doing the obvious thing here doesn't work:

error[E0119]: conflicting implementations of trait `EnvironmentItem` for type `(std::ffi::OsString, std::ffi::OsString)`:
   --> src/lib.rs:248:1
    |
236 | impl EnvironmentItem for (OsString, OsString) {
    | --------------------------------------------- first implementation here
...
248 | impl<T: ToString, Z: ToString> EnvironmentItem for (T, Z) {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(std::ffi::OsString, std::ffi::OsString)`
    |
    = note: upstream crates may add new impl of trait `std::fmt::Display` for type `std::ffi::OsString` in future versions
luser commented 6 years ago

This is https://github.com/rust-lang/rust/issues/45542 apparently.