Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impl EnvironmentItem for (OsString, OsString) #14

Open
luser opened this issue Jul 26, 2018 · 2 comments
Open

impl EnvironmentItem for (OsString, OsString) #14

luser opened this issue Jul 26, 2018 · 2 comments

Comments

@luser
Copy link

luser commented Jul 26, 2018

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
Copy link
Author

luser commented Jul 26, 2018

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
Copy link
Author

luser commented Jul 26, 2018

This is rust-lang/rust#45542 apparently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant