我有一个依赖于string_cache的Rust项目,它需要使用nightly版本。然而,最新版本的nightly由于过时的特性而无法编译:
$ cargo build
Compiling string_cache v0.1.0 (https://github.com/servo/string-cache#45f19068)
/home/wilfred/.multirust/toolchains/nightly/cargo/git/checkouts/string-cache-efa5c30b1d5a962c/master/src/atom/mod.rs:65:21: 65:37 error: use of deprecated item: use `String::from` instead, #[deny(deprecated)] on by default
/home/wilfred/.multirust/toolchains/nightly/cargo/git/checkouts/string-cache-efa5c30b1d5a962c/master/src/atom/mod.rs:65 string: String::from_str(string_to_add),
^~~~~~~~~~~~~~~~
error: aborting due to previous error
Could not compile `string_cache`.
To learn more, run the command again with --verbose.
我该如何编译string_cache?我尝试添加了一些内容。
#![allow(deprecated)]
我将对我的main.rs进行更改,但这并不会改变其行为。
#[deny(deprecated)]
是由库本身设置的。我能覆盖它吗? - Wilfred Hughes