This
fn main() {
let test = "Foo".to_string();
test.to_lowercase();
}
produces an error
error: use of unstable library feature 'collections'
test.to_lowercase();
^~~~~~~~~~~~~~
but I am using
rustc 1.2.0-nightly (f76d9bcfc 2015-05-28) (built 2015-05-28)
and according to http://doc.rust-lang.org/1.0.0/book/release-channels.html unstable features are enabled on nightly. I've also tried stable and beta, but the error is exactly the same. So what's the issue here?
You need to explicitly opt-in by placing #![feature(collections)]
at the top of your crate's root source file. Using a nightly compiler merely permits you to use unstable features, it doesn't automatically enable them.
See also this related SO question.
If you look below the error message (on nightly), there's a hint as to what you need to do to activate this feature (just because it's in the nightly, doesn't mean the feature is active)
<anon>:3:10: 3:24 help: add #![feature(collections)] to the crate attributes to enable
error: aborting due to previous error
Always read the full error message, especially the note:
and help:
parts. These often tell you how to fix the error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With