@@ -60,7 +60,6 @@ use rustc_session::lint::{Lint, LintId};
60
60
use rustc_session:: output:: collect_crate_types;
61
61
use rustc_session:: { EarlyDiagCtxt , Session , config, filesearch} ;
62
62
use rustc_span:: FileName ;
63
- use rustc_span:: source_map:: FileLoader ;
64
63
use rustc_target:: json:: ToJson ;
65
64
use rustc_target:: spec:: { Target , TargetTuple } ;
66
65
use time:: OffsetDateTime ;
@@ -211,59 +210,20 @@ pub fn diagnostics_registry() -> Registry {
211
210
pub struct RunCompiler <' a> {
212
211
at_args: & ' a [ String ] ,
213
212
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 >>,
217
213
}
218
214
219
215
impl <' a> RunCompiler <' a> {
220
216
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 }
251
218
}
252
219
253
220
/// Parse args and run the compiler.
254
221
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) ;
256
223
}
257
224
}
258
225
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 ) ) {
267
227
let mut default_early_dcx = EarlyDiagCtxt :: new( ErrorOutputType :: default ( ) ) ;
268
228
269
229
// Throw away the first argument, the name of the binary.
@@ -300,14 +260,14 @@ fn run_compiler(
300
260
output_file: ofile,
301
261
output_dir: odir,
302
262
ice_file,
303
- file_loader,
263
+ file_loader: None ,
304
264
locale_resources: DEFAULT_LOCALE_RESOURCES . to_vec( ) ,
305
265
lint_caps: Default :: default ( ) ,
306
266
psess_created: None ,
307
267
hash_untracked_state: None ,
308
268
register_lints: None ,
309
269
override_queries: None ,
310
- make_codegen_backend,
270
+ make_codegen_backend: None ,
311
271
registry: diagnostics_registry( ) ,
312
272
using_internal_features: & USING_INTERNAL_FEATURES ,
313
273
expanded_args: args,
0 commit comments