I tried to build the following rust file, and get an error.
src/main.rs
:
#![feature(rustc_private)]
extern crate rustc_driver;
fn main() {
let value = Some(42);
//...
}
cargo.toml
:
[package]
name = "cargo_test"
version = "0.1.0"
authors = ["XXX"]
edition = "2018"
[dependencies]
errors:
(base) ➜ cargo_test git:(master) ✗ cargo build
Compiling cargo_test v0.1.0 (XXX/cargo_test)
error[E0463]: can't find crate for `rustc_driver`
--> src/main.rs:3:1
|
3 | extern crate rustc_driver;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: could not compile `cargo_test`
To learn more, run the command again with --verbose.
rustc
version:
(base) ➜ cargo_test git:(master) ✗ rustc --version
rustc 1.53.0-nightly (673d0db5e 2021-03-23)
What can I do to fix the problem?