"use of unstable library feature 'collections'" using nightly

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.

Tags:

Rust