I have recently started to use the programming language Rust for some of the projects and, as would be expected from using new language, I end up encountering many errors. One of the most prominent of the errors is:
error[E0554]: #![feature] may not be used on the stable release channel --> src/main.rs:2:1
This is because the stable compiler of Rust does not allows use of unstable features by default. As such if you need to use the unstable features then using the
nightly release of the Rust compiler is the way to go.
Installing and switching between the
normal <--> nighty build is pretty straightforward using the Rustup:
rustup install nightly rustup default nightly
This should setup your rust to be on nightly build and to switch it back a simple
rustup default stable would do the work.
Setting up the build for specific project
Setting up the rust to nightly build will solve the error but doing it globally is a bit overstretching. Thankfully you can easily setup release per project using the following line:
rustup override add nightly
within the project directly.