如何同时使用Futures 0.1和Futures-preview 0.3包装箱?

时间:2018-12-13 23:04:12

标签: rust rust-cargo

我需要在项目中同时使用futures-previewfutures。我的Cargo.toml看起来像:

[dependencies]
futures-preview = "= 0.3.0-alpha.7"
futures = "0.1.25"

现在,当我这样做时,在我的lib.rs

extern crate futures;

对于使用哪种期货板条箱,罗斯特感到困惑。如何同时使用两个具有相同extern crate名称的板条箱?

   Compiling spdk-rs v0.1.0 (/home/zeyuanhu/share/rustfs/spdk-rs)
error[E0465]: multiple rlib candidates for `futures` found
  --> /home/zeyuanhu/share/rustfs/spdk-rs/src/lib.rs:17:1
   |
17 | extern crate futures;
   | ^^^^^^^^^^^^^^^^^^^^^
   |
note: candidate #1: /home/zeyuanhu/share/rustfs/examples/hello_nvme_bdev_rust_wrapper/target/debug/deps/libfutures-ac8c40146fd4a4e0.rlib
  --> /home/zeyuanhu/share/rustfs/spdk-rs/src/lib.rs:17:1
   |
17 | extern crate futures;
   | ^^^^^^^^^^^^^^^^^^^^^
note: candidate #2: /home/zeyuanhu/share/rustfs/examples/hello_nvme_bdev_rust_wrapper/target/debug/deps/libfutures-44db24e7af1a2bd3.rlib
  --> /home/zeyuanhu/share/rustfs/spdk-rs/src/lib.rs:17:1
   |
17 | extern crate futures;
   | ^^^^^^^^^^^^^^^^^^^^^

error[E0463]: can't find crate for `futures`
  --> /home/zeyuanhu/share/rustfs/spdk-rs/src/lib.rs:17:1
   |
17 | extern crate futures;
   | ^^^^^^^^^^^^^^^^^^^^^ can't find crate

0 个答案:

没有答案