From 084c492ca17fafa3aea0a4c1c6ba1fa4f02d3727 Mon Sep 17 00:00:00 2001 From: Makai Date: Sat, 1 Nov 2025 15:51:46 +0800 Subject: [PATCH 1/2] rustc_public: make the `unstable` module public --- compiler/rustc_public/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_public/src/lib.rs b/compiler/rustc_public/src/lib.rs index 958b3b2647889..e2ca9159bff37 100644 --- a/compiler/rustc_public/src/lib.rs +++ b/compiler/rustc_public/src/lib.rs @@ -41,7 +41,7 @@ use crate::unstable::Stable; pub mod abi; mod alloc; -pub(crate) mod unstable; +pub mod unstable; #[macro_use] pub mod crate_def; pub mod compiler_interface; From fc3057b9c077b0f45422ff863b7339c39211e19f Mon Sep 17 00:00:00 2001 From: Makai Date: Sat, 1 Nov 2025 15:54:27 +0800 Subject: [PATCH 2/2] rustc_public: add `#[cfg(feature = "rustc_internal")]` to `compiler_interface:run()` --- compiler/rustc_public/src/compiler_interface.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_public/src/compiler_interface.rs b/compiler/rustc_public/src/compiler_interface.rs index b17d31f2b91ab..47d781d41abe7 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 ()>); +// FIXME(makai410): 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,