syncer icon indicating copy to clipboard operation
syncer copied to clipboard

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

Open happybeing opened this issue 5 years ago • 3 comments

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 avatar Jun 28 '20 14:06 happybeing

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

happybeing avatar Jun 28 '20 14:06 happybeing

Update: I found Cargo issue https://github.com/rust-lang/cargo/issues/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 avatar Jun 28 '20 14:06 happybeing

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! :smile:

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

happybeing avatar Jun 28 '20 14:06 happybeing