@@ -60,7 +60,6 @@ use rustc_session::lint::{Lint, LintId};
6060use rustc_session:: output:: collect_crate_types;
6161use rustc_session:: { EarlyDiagCtxt , Session , config, filesearch} ;
6262use rustc_span:: FileName ;
63- use rustc_span:: source_map:: FileLoader ;
6463use rustc_target:: json:: ToJson ;
6564use rustc_target:: spec:: { Target , TargetTuple } ;
6665use time:: OffsetDateTime ;
@@ -211,59 +210,20 @@ pub fn diagnostics_registry() -> Registry {
211210pub struct RunCompiler <' a> {
212211 at_args: & ' a [ String ] ,
213212 callbacks: & ' a mut ( dyn Callbacks + Send ) ,
214- file_loader: Option <Box <dyn FileLoader + Send + Sync >>,
215- make_codegen_backend:
216- Option <Box <dyn FnOnce ( & config:: Options ) -> Box <dyn CodegenBackend > + Send >>,
217213}
218214
219215impl <' a> RunCompiler <' a> {
220216 pub fn new( at_args: & ' a [ String ] , callbacks: & ' a mut ( dyn Callbacks + Send ) ) -> Self {
221- Self { at_args, callbacks, file_loader: None , make_codegen_backend: None }
222- }
223-
224- /// Set a custom codegen backend.
225- ///
226- /// Has no uses within this repository, but is used by bjorn3 for "the
227- /// hotswapping branch of cg_clif" for "setting the codegen backend from a
228- /// custom driver where the custom codegen backend has arbitrary data."
229- /// (See #102759.)
230- pub fn set_make_codegen_backend(
231- & mut self ,
232- make_codegen_backend: Option <
233- Box <dyn FnOnce ( & config:: Options ) -> Box <dyn CodegenBackend > + Send >,
234- >,
235- ) -> & mut Self {
236- self . make_codegen_backend = make_codegen_backend;
237- self
238- }
239-
240- /// Load files from sources other than the file system.
241- ///
242- /// Has no uses within this repository, but may be used in the future by
243- /// bjorn3 for "hooking rust-analyzer's VFS into rustc at some point for
244- /// running rustc without having to save". (See #102759.)
245- pub fn set_file_loader(
246- & mut self ,
247- file_loader: Option <Box <dyn FileLoader + Send + Sync >>,
248- ) -> & mut Self {
249- self . file_loader = file_loader;
250- self
217+ Self { at_args, callbacks }
251218 }
252219
253220 /// Parse args and run the compiler.
254221 pub fn run( self ) {
255- run_compiler( self . at_args, self . callbacks, self . file_loader , self . make_codegen_backend ) ;
222+ run_compiler( self . at_args, self . callbacks) ;
256223 }
257224}
258225
259- fn run_compiler(
260- at_args: & [ String ] ,
261- callbacks: & mut ( dyn Callbacks + Send ) ,
262- file_loader: Option <Box <dyn FileLoader + Send + Sync >>,
263- make_codegen_backend: Option <
264- Box <dyn FnOnce ( & config:: Options ) -> Box <dyn CodegenBackend > + Send >,
265- >,
266- ) {
226+ fn run_compiler( at_args: & [ String ] , callbacks: & mut ( dyn Callbacks + Send ) ) {
267227 let mut default_early_dcx = EarlyDiagCtxt :: new( ErrorOutputType :: default ( ) ) ;
268228
269229 // Throw away the first argument, the name of the binary.
@@ -300,14 +260,14 @@ fn run_compiler(
300260 output_file: ofile,
301261 output_dir: odir,
302262 ice_file,
303- file_loader,
263+ file_loader: None ,
304264 locale_resources: DEFAULT_LOCALE_RESOURCES . to_vec( ) ,
305265 lint_caps: Default :: default ( ) ,
306266 psess_created: None ,
307267 hash_untracked_state: None ,
308268 register_lints: None ,
309269 override_queries: None ,
310- make_codegen_backend,
270+ make_codegen_backend: None ,
311271 registry: diagnostics_registry( ) ,
312272 using_internal_features: & USING_INTERNAL_FEATURES ,
313273 expanded_args: args,
0 commit comments