Rust errors / Attributes, macros and features
Rust compiler error · checked with rustc 1.99.0
Rust error E0658: is unstable
What it meansThe code uses a feature that only exists on nightly Rust. Either switch to a stable alternative or opt in on nightly with #![feature(..)].
What rustc prints
error[E0658]: use of unstable library feature `core_intrinsics`: intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library
--> main.rs:1:5
|
1 | use std::intrinsics; // error: use of unstable library feature `core_intrinsics`
| ^^^^^^^^^^^^^^^Real output of rustc 1.99.0 compiling the official example below (2021 edition). Your names and line numbers will differ; the first line is the part to match.
Why it happens
- A crate or snippet written for nightly.
- An MSRV mismatch: the feature was stabilised in a newer Rust than you run.
How to fix it
1. Update Rust
Many features become stable; check the release notes.
rustup update stable2. Use nightly for this project
rustup override set nightlyOther wordings of this error
is unstable, use of unstable library feature, add `#![feature, is experimental
The compiler team's explanation
An unstable feature was used.
Erroneous code example:
use std::intrinsics; // error: use of unstable library feature `core_intrinsics`
If you're using a stable or a beta version of rustc, you won't be able to use any unstable features. In order to do so, please switch to a nightly version of rustc (by using rustup).
If you're using a nightly version of rustc, just add the corresponding feature to be able to use it:
#![feature(core_intrinsics)]
use std::intrinsics; // ok!From rustc --explain E0658 (1.99.0), part of the Rust project, MIT or Apache-2.0. Official page.
Related errors
Up next
Often hit nextE0602: An unknown or invalid lint was used on the command lineA related error from the same family.Read it next →Did this answer your question?