diff --git a/compiler/rustc_public/src/compiler_interface.rs b/compiler/rustc_public/src/compiler_interface.rs index b17d31f2b91ab..e01ffa2309049 100644 --- a/compiler/rustc_public/src/compiler_interface.rs +++ b/compiler/rustc_public/src/compiler_interface.rs @@ -835,6 +835,8 @@ impl<'tcx> CompilerInterface<'tcx> { // A thread local variable that stores a pointer to [`CompilerInterface`]. scoped_tls::scoped_thread_local!(static TLV: Cell<*const ()>); +// remove this cfg when we have a stable driver. +#[cfg(feature = "rustc_internal")] pub(crate) fn run<'tcx, F, T>(interface: &CompilerInterface<'tcx>, f: F) -> Result where F: FnOnce() -> T, diff --git a/compiler/rustc_public/src/unstable/mod.rs b/compiler/rustc_public/src/unstable/mod.rs index 72b14cfa072ae..2b69fb5408cf9 100644 --- a/compiler/rustc_public/src/unstable/mod.rs +++ b/compiler/rustc_public/src/unstable/mod.rs @@ -22,6 +22,7 @@ mod internal_cx; /// /// This trait is only for [`RustcInternal`]. Any other other access to rustc's internals /// should go through [`rustc_public_bridge::context::CompilerCtxt`]. +#[cfg_attr(not(feature = "rustc_internal"), allow(unreachable_pub))] pub trait InternalCx<'tcx>: Copy + Clone { fn tcx(self) -> TyCtxt<'tcx>; @@ -59,6 +60,7 @@ pub trait InternalCx<'tcx>: Copy + Clone { /// between internal MIR and rustc_public's IR constructs. /// However, they should be used seldom and they have no influence in this crate semver. #[doc(hidden)] +#[cfg_attr(not(feature = "rustc_internal"), allow(unreachable_pub))] pub trait Stable<'tcx>: PointeeSized { /// The stable representation of the type implementing Stable. type T; @@ -78,6 +80,7 @@ pub trait Stable<'tcx>: PointeeSized { /// between internal MIR and rustc_public's IR constructs. /// They should be used seldom as they have no stability guarantees. #[doc(hidden)] +#[cfg_attr(not(feature = "rustc_internal"), allow(unreachable_pub))] pub trait RustcInternal { type T<'tcx>; fn internal<'tcx>(