这个
fn main() {
let test = "Foo".to_string();
test.to_lowercase();
}
产生错误
error: use of unstable library feature 'collections'
test.to_lowercase();
^~~~~~~~~~~~~~
但我正在使用
rustc 1.2.0-nightly (f76d9bcfc 2015-05-28) (built 2015-05-28)
并根据http://doc.rust-lang.org/1.0.0/book/release-channels.html每晚启用不稳定的功能。我也试过稳定版和测试版,但错误完全一样。那么这里的问题是什么?
最佳答案
您需要通过将 #![feature(collections)]
放在 crate 根源文件的顶部来明确选择加入。使用夜间编译器仅允许您使用不稳定的功能,它不会自动启用它们。
另见 related SO question .
关于rust - "use of unstable library feature ' 集合 '"每晚使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30506120/