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

'cargo install -f syncer' fails with 'conflicting implementations of trait std::convert::From<&_> ...' #8

Open
happybeing opened this issue Jun 28, 2020 · 3 comments

Comments

@happybeing
Copy link

Both

cargo install -f syncer

and

cargo install -f --debug syncer 

Give the following error but cargo update && cargo build and cargo build --release both succeed.

  Compiling blake2 v0.7.1
   Compiling rusqlite v0.13.0
error[E0119]: conflicting implementations of trait `std::convert::From<&_>` for type `types::to_sql::ToSqlOutput<'_>`:
  --> /home/mrh/.cargo/registry/src/github.com-1ecc6299db9ec823/rusqlite-0.13.0/src/types/to_sql.rs:26:1
   |
18 | / impl<'a, T: ?Sized> From<&'a T> for ToSqlOutput<'a>
19 | |     where &'a T: Into<ValueRef<'a>>
20 | | {
21 | |     fn from(t: &'a T) -> Self {
22 | |         ToSqlOutput::Borrowed(t.into())
23 | |     }
24 | | }
   | |_- first implementation here
25 | 
26 |   impl<'a, T: Into<Value>> From<T> for ToSqlOutput<'a> {
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `types::to_sql::ToSqlOutput<'_>`
   |
   = note: downstream crates may implement trait `std::convert::From<&_>` for type `types::value::Value`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0119`.
error: could not compile `rusqlite`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `syncer v0.5.1`, intermediate artifacts can be found at `/tmp/cargo-installmEHbMA`

Caused by:
  build failed
@happybeing
Copy link
Author

Above is with a clone of master on Ubuntu 19.04 using Rustc v1.44.0, Cargo v1.44.0.

@happybeing
Copy link
Author

Update: I found Cargo issue rust-lang/cargo#7169 and so tried:

git checkout Cargo.lock # which ensures I'm up to date with your master
cargo install -f --locked syncer

But still get the same error. I'm not fluent in Cargo or Rustc so don't understand what the difference might be between cargo build and cargo install.

@happybeing
Copy link
Author

Workaround

I'm not sure why cargo install -f --locked syncer fails or why cargo update && cargo build can succeed (since that presumably gets latest package versions?).

However, using cargo install --path . works, so the following appears to be ok:

cargo update && cargo build && cargo install --path .

Haven't tried running syncer yet though! 😄

I'll leave this open as the README instructions may not work currently as they suggest cargo install -f syncer

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