1
Fork 0

Fix standalone build

Add extern declarations and optional dependencies to fix build done
directly via `cargo build`.
This commit is contained in:
Celina G. Val 2023-06-20 10:32:12 -07:00
parent 05b82e551e
commit 44d0fce150
4 changed files with 17 additions and 2 deletions

View file

@ -14,6 +14,16 @@
#![feature(local_key_cell_methods)]
#![feature(ptr_metadata)]
// Declare extern rustc_* crates to enable building this crate separately from the compiler.
#[cfg(not(feature = "default"))]
extern crate rustc_hir;
#[cfg(not(feature = "default"))]
extern crate rustc_middle;
#[cfg(not(feature = "default"))]
extern crate rustc_span;
#[cfg(not(feature = "default"))]
extern crate rustc_target;
pub mod rustc_internal;
pub mod stable_mir;