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