@@ -321,8 +321,10 @@ impl Step for CodegenBackend {
321321 }
322322}
323323
324+ /// Checks Rust analyzer that links to .rmetas from a checked rustc.
324325#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
325326pub struct RustAnalyzer {
327+ pub build_compiler : Compiler ,
326328 pub target : TargetSelection ,
327329}
328330
@@ -343,18 +345,17 @@ impl Step for RustAnalyzer {
343345 }
344346
345347 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 } ) ;
347350 }
348351
349352 fn run ( self , builder : & Builder < ' _ > ) {
350- let compiler = builder . compiler ( builder . top_stage , builder . config . host_target ) ;
353+ let build_compiler = self . build_compiler ;
351354 let target = self . target ;
352355
353- builder. ensure ( Rustc :: new ( target, builder) ) ;
354-
355356 let mut cargo = prepare_tool_cargo (
356357 builder,
357- compiler ,
358+ build_compiler ,
358359 Mode :: ToolRustc ,
359360 target,
360361 builder. kind ,
@@ -371,12 +372,16 @@ impl Step for RustAnalyzer {
371372
372373 // Cargo's output path in a given stage, compiled by a particular
373374 // 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) )
375376 . with_prefix ( "rust-analyzer-check" ) ;
376377
377378 let _guard = builder. msg_check ( "rust-analyzer artifacts" , target, None ) ;
378379 run_cargo ( builder, cargo, builder. config . free_args . clone ( ) , & stamp, vec ! [ ] , true , false ) ;
379380 }
381+
382+ fn metadata ( & self ) -> Option < StepMetadata > {
383+ Some ( StepMetadata :: check ( "rust-analyzer" , self . target ) . built_by ( self . build_compiler ) )
384+ }
380385}
381386
382387/// Compiletest is implicitly "checked" when it gets built in order to run tests,
0 commit comments