@@ -323,8 +323,10 @@ impl Step for CodegenBackend {
323323 }
324324}
325325
326+ /// Checks Rust analyzer that links to .rmetas from a checked rustc.
326327#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
327328pub struct RustAnalyzer {
329+ pub build_compiler : Compiler ,
328330 pub target : TargetSelection ,
329331}
330332
@@ -345,18 +347,17 @@ impl Step for RustAnalyzer {
345347 }
346348
347349 fn make_run ( run : RunConfig < ' _ > ) {
348- run. builder . ensure ( RustAnalyzer { target : run. target } ) ;
350+ let build_compiler = prepare_compiler_for_tool_rustc ( run. builder , run. target ) ;
351+ run. builder . ensure ( RustAnalyzer { build_compiler, target : run. target } ) ;
349352 }
350353
351354 fn run ( self , builder : & Builder < ' _ > ) {
352- let compiler = builder . compiler ( builder . top_stage , builder . config . host_target ) ;
355+ let build_compiler = self . build_compiler ;
353356 let target = self . target ;
354357
355- builder. ensure ( Rustc :: new ( target, builder) ) ;
356-
357358 let mut cargo = prepare_tool_cargo (
358359 builder,
359- compiler ,
360+ build_compiler ,
360361 Mode :: ToolRustc ,
361362 target,
362363 builder. kind ,
@@ -373,12 +374,16 @@ impl Step for RustAnalyzer {
373374
374375 // Cargo's output path in a given stage, compiled by a particular
375376 // compiler for the specified target.
376- let stamp = BuildStamp :: new ( & builder. cargo_out ( compiler , Mode :: ToolRustc , target) )
377+ let stamp = BuildStamp :: new ( & builder. cargo_out ( build_compiler , Mode :: ToolRustc , target) )
377378 . with_prefix ( "rust-analyzer-check" ) ;
378379
379380 let _guard = builder. msg_check ( "rust-analyzer artifacts" , target, None ) ;
380381 run_cargo ( builder, cargo, builder. config . free_args . clone ( ) , & stamp, vec ! [ ] , true , false ) ;
381382 }
383+
384+ fn metadata ( & self ) -> Option < StepMetadata > {
385+ Some ( StepMetadata :: check ( "rust-analyzer" , self . target ) . built_by ( self . build_compiler ) )
386+ }
382387}
383388
384389/// Compiletest is implicitly "checked" when it gets built in order to run tests,
0 commit comments