@@ -321,8 +321,10 @@ impl Step for CodegenBackend {
321
321
}
322
322
}
323
323
324
+ /// Checks Rust analyzer that links to .rmetas from a checked rustc.
324
325
#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
325
326
pub struct RustAnalyzer {
327
+ pub build_compiler : Compiler ,
326
328
pub target : TargetSelection ,
327
329
}
328
330
@@ -343,18 +345,17 @@ impl Step for RustAnalyzer {
343
345
}
344
346
345
347
fn make_run ( run : RunConfig < ' _ > ) {
346
- run. builder . ensure ( RustAnalyzer { target : run. target } ) ;
348
+ let build_compiler = prepare_compiler_for_tool_rustc ( run. builder , run. target ) ;
349
+ run. builder . ensure ( RustAnalyzer { build_compiler, target : run. target } ) ;
347
350
}
348
351
349
352
fn run ( self , builder : & Builder < ' _ > ) {
350
- let compiler = builder . compiler ( builder . top_stage , builder . config . host_target ) ;
353
+ let build_compiler = self . build_compiler ;
351
354
let target = self . target ;
352
355
353
- builder. ensure ( Rustc :: new ( target, builder) ) ;
354
-
355
356
let mut cargo = prepare_tool_cargo (
356
357
builder,
357
- compiler ,
358
+ build_compiler ,
358
359
Mode :: ToolRustc ,
359
360
target,
360
361
builder. kind ,
@@ -371,12 +372,16 @@ impl Step for RustAnalyzer {
371
372
372
373
// Cargo's output path in a given stage, compiled by a particular
373
374
// compiler for the specified target.
374
- let stamp = BuildStamp :: new ( & builder. cargo_out ( compiler , Mode :: ToolRustc , target) )
375
+ let stamp = BuildStamp :: new ( & builder. cargo_out ( build_compiler , Mode :: ToolRustc , target) )
375
376
. with_prefix ( "rust-analyzer-check" ) ;
376
377
377
378
let _guard = builder. msg_check ( "rust-analyzer artifacts" , target, None ) ;
378
379
run_cargo ( builder, cargo, builder. config . free_args . clone ( ) , & stamp, vec ! [ ] , true , false ) ;
379
380
}
381
+
382
+ fn metadata ( & self ) -> Option < StepMetadata > {
383
+ Some ( StepMetadata :: check ( "rust-analyzer" , self . target ) . built_by ( self . build_compiler ) )
384
+ }
380
385
}
381
386
382
387
/// Compiletest is implicitly "checked" when it gets built in order to run tests,
0 commit comments