Hi there!
I've been working on a simple cryptography crate (for learning purposes) and I'd ideally need generic_const_exprs
to determine the size of an array at compile time based on a generic argument. To do this I'd like to enable the generic_const_exprs
feature and use the nightly compiler, however, this is proving to be harder than I thought. My lib.rs contains
#![feature(generic_const_exprs)]
at the top, I have downloaded and installed the nightly compiler, and overridden the compiler version using both rustup default nightly
and rustup override set nightly
. I've even invoked cargo using rustup run nightly cargo build
, yet I still keep getting this error!
error[E0554]: `#![feature]` may not be used on the stable release channel
--> src/lib.rs:1:1
|
1 | #![feature(generic_const_exprs)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I'm sure I'm just missing something trivial, yet I've been pulling my hair out the past couple of days trying to get it to compile. Could it be Homebrew messing things up or am I missing something? Additional info below.
$ which cargo
/usr/local/bin/cargo
$ which rustup
/Users/jake/.cargo/bin/rustup
$ cargo --version
cargo 1.79.0
$ rustup --version
rustup 1.27.1 (54dd3d00f 2024-04-24)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.81.0-nightly (5affbb171 2024-07-18)`
$ rustup show
Default host: x86_64-apple-darwin
rustup home: /Users/jake/.rustup
installed toolchains
--------------------
stable-x86_64-apple-darwin
nightly-x86_64-apple-darwin (default)
active toolchain
----------------
nightly-x86_64-apple-darwin (directory override for '/Users/jake/nightly-test')
rustc 1.81.0-nightly (5affbb171 2024-07-18)