找不到“rustc_driver”的箱子

问题描述

我尝试构建以下 Rust 文件,但出现错误

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]

错误

(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 版本:

(base) ➜  cargo_test git:(master) ✗ rustc --version
rustc 1.53.0-nightly (673d0db5e 2021-03-23)

我该怎么做才能解决问题?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)