这个
fn main() {
let test = "Foo".to_string();
test.to_lowercase();
}
Run Code Online (Sandbox Code Playgroud)
产生错误
error: use of unstable library feature 'collections'
test.to_lowercase();
^~~~~~~~~~~~~~
Run Code Online (Sandbox Code Playgroud)
但我正在使用
rustc 1.2.0-nightly (f76d9bcfc 2015-05-28) (built 2015-05-28)
Run Code Online (Sandbox Code Playgroud)
并根据http://doc.rust-lang.org/1.0.0/book/release-channels.html每晚启用不稳定功能.我也试过稳定版和测试版,但错误完全相同.那么这里的问题是什么?
oli*_*obk 14
如果您查看错误消息(每晚),则会提示您需要做什么来激活此功能(仅因为它在夜间,并不意味着该功能处于活动状态)
<anon>:3:10: 3:24 help: add #![feature(collections)] to the crate attributes to enable
error: aborting due to previous error
Run Code Online (Sandbox Code Playgroud)
始终阅读完整的错误消息,尤其是note:和help:部分.这些通常会告诉您如何修复错误.
| 归档时间: |
|
| 查看次数: |
10901 次 |
| 最近记录: |