@@ -33,15 +33,12 @@ extern crate rustc_resolve;
33
33
extern crate rustc_save_analysis;
34
34
#[ allow( unused_extern_crates) ]
35
35
extern crate syntax;
36
- use self :: rustc:: session:: config:: { self , ErrorOutputType , Input } ;
36
+ use self :: rustc:: session:: config:: Input ;
37
37
use self :: rustc:: session:: Session ;
38
- use self :: rustc_codegen_utils:: codegen_backend:: CodegenBackend ;
39
38
use self :: rustc_driver:: driver:: CompileController ;
40
- use self :: rustc_driver:: { run, run_compiler, Compilation , CompilerCalls , RustcDefaultCalls } ;
41
- use self :: rustc_metadata:: cstore:: CStore ;
39
+ use self :: rustc_driver:: { run, run_compiler, CompilerCalls , RustcDefaultCalls } ;
42
40
use self :: rustc_save_analysis as save;
43
41
use self :: rustc_save_analysis:: CallbackHandler ;
44
- use self :: syntax:: ast;
45
42
use self :: syntax:: edition:: Edition as RustcEdition ;
46
43
use self :: syntax:: source_map:: { FileLoader , RealFileLoader } ;
47
44
@@ -153,7 +150,6 @@ pub(crate) fn rustc(
153
150
// controller, but use our own callback for save-analysis.
154
151
#[ derive( Clone ) ]
155
152
struct RlsRustcCalls {
156
- default_calls : Box < RustcDefaultCalls > ,
157
153
analysis : Arc < Mutex < Option < Analysis > > > ,
158
154
input_files : Arc < Mutex < HashMap < PathBuf , HashSet < Crate > > > > ,
159
155
clippy_preference : ClippyPreference ,
@@ -165,12 +161,7 @@ impl RlsRustcCalls {
165
161
input_files : Arc < Mutex < HashMap < PathBuf , HashSet < Crate > > > > ,
166
162
clippy_preference : ClippyPreference ,
167
163
) -> RlsRustcCalls {
168
- RlsRustcCalls {
169
- default_calls : Box :: new ( RustcDefaultCalls ) ,
170
- analysis,
171
- input_files,
172
- clippy_preference,
173
- }
164
+ RlsRustcCalls { analysis, input_files, clippy_preference }
174
165
}
175
166
}
176
167
@@ -217,42 +208,6 @@ fn clippy_after_parse_callback(state: &mut rustc_driver::driver::CompileState<'_
217
208
}
218
209
219
210
impl < ' a > CompilerCalls < ' a > for RlsRustcCalls {
220
- fn early_callback (
221
- & mut self ,
222
- matches : & getopts:: Matches ,
223
- sopts : & config:: Options ,
224
- cfg : & ast:: CrateConfig ,
225
- descriptions : & rustc_errors:: registry:: Registry ,
226
- output : ErrorOutputType ,
227
- ) -> Compilation {
228
- self . default_calls . early_callback ( matches, sopts, cfg, descriptions, output)
229
- }
230
-
231
- fn no_input (
232
- & mut self ,
233
- matches : & getopts:: Matches ,
234
- sopts : & config:: Options ,
235
- cfg : & ast:: CrateConfig ,
236
- odir : & Option < PathBuf > ,
237
- ofile : & Option < PathBuf > ,
238
- descriptions : & rustc_errors:: registry:: Registry ,
239
- ) -> Option < ( Input , Option < PathBuf > ) > {
240
- self . default_calls . no_input ( matches, sopts, cfg, odir, ofile, descriptions)
241
- }
242
-
243
- fn late_callback (
244
- & mut self ,
245
- codegen_backend : & dyn CodegenBackend ,
246
- matches : & getopts:: Matches ,
247
- sess : & Session ,
248
- cstore : & CStore ,
249
- input : & Input ,
250
- odir : & Option < PathBuf > ,
251
- ofile : & Option < PathBuf > ,
252
- ) -> Compilation {
253
- self . default_calls . late_callback ( codegen_backend, matches, sess, cstore, input, odir, ofile)
254
- }
255
-
256
211
#[ allow( clippy:: boxed_local) ] // https://github.com/rust-lang/rust-clippy/issues/1123
257
212
fn build_controller (
258
213
self : Box < Self > ,
@@ -263,7 +218,7 @@ impl<'a> CompilerCalls<'a> for RlsRustcCalls {
263
218
let input_files = self . input_files . clone ( ) ;
264
219
#[ cfg( feature = "clippy" ) ]
265
220
let clippy_preference = self . clippy_preference ;
266
- let mut result = self . default_calls . build_controller ( sess, matches) ;
221
+ let mut result = Box :: new ( RustcDefaultCalls ) . build_controller ( sess, matches) ;
267
222
result. keep_ast = true ;
268
223
269
224
#[ cfg( feature = "clippy" ) ]
0 commit comments