@@ -1334,9 +1334,10 @@ impl Step for Cargo {
13341334 }
13351335}
13361336
1337+ /// Distribute the rust-analyzer component, which is used as a LSP by various IDEs.
13371338#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
13381339pub struct RustAnalyzer {
1339- pub build_compiler : Compiler ,
1340+ pub compilers : RustcPrivateCompilers ,
13401341 pub target : TargetSelection ,
13411342}
13421343
@@ -1352,21 +1353,14 @@ impl Step for RustAnalyzer {
13521353
13531354 fn make_run ( run : RunConfig < ' _ > ) {
13541355 run. builder . ensure ( RustAnalyzer {
1355- build_compiler : run. builder . compiler_for (
1356- run. builder . top_stage ,
1357- run. builder . config . host_target ,
1358- run. target ,
1359- ) ,
1356+ compilers : RustcPrivateCompilers :: new ( run. builder , run. builder . top_stage , run. target ) ,
13601357 target : run. target ,
13611358 } ) ;
13621359 }
13631360
13641361 fn run ( self , builder : & Builder < ' _ > ) -> Option < GeneratedTarball > {
13651362 let target = self . target ;
1366- let compilers =
1367- RustcPrivateCompilers :: from_build_compiler ( builder, self . build_compiler , self . target ) ;
1368-
1369- let rust_analyzer = builder. ensure ( tool:: RustAnalyzer :: from_compilers ( compilers) ) ;
1363+ let rust_analyzer = builder. ensure ( tool:: RustAnalyzer :: from_compilers ( self . compilers ) ) ;
13701364
13711365 let mut tarball = Tarball :: new ( builder, "rust-analyzer" , & target. triple ) ;
13721366 tarball. set_overlay ( OverlayKind :: RustAnalyzer ) ;
@@ -1375,6 +1369,13 @@ impl Step for RustAnalyzer {
13751369 tarball. add_legal_and_readme_to ( "share/doc/rust-analyzer" ) ;
13761370 Some ( tarball. generate ( ) )
13771371 }
1372+
1373+ fn metadata ( & self ) -> Option < StepMetadata > {
1374+ Some (
1375+ StepMetadata :: dist ( "rust-analyzer" , self . target )
1376+ . built_by ( self . compilers . build_compiler ( ) ) ,
1377+ )
1378+ }
13781379}
13791380
13801381#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
@@ -1672,7 +1673,7 @@ impl Step for Extended {
16721673 add_component ! ( "rust-json-docs" => JsonDocs { build_compiler: target_compiler, target } ) ;
16731674 add_component ! ( "cargo" => Cargo { build_compiler: compiler, target } ) ;
16741675 add_component ! ( "rustfmt" => Rustfmt { build_compiler: compiler, target } ) ;
1675- add_component ! ( "rust-analyzer" => RustAnalyzer { build_compiler : compiler, target } ) ;
1676+ add_component ! ( "rust-analyzer" => RustAnalyzer { compilers : RustcPrivateCompilers :: from_build_compiler ( builder , compiler, target ) , target } ) ;
16761677 add_component ! ( "llvm-components" => LlvmTools { target } ) ;
16771678 add_component ! ( "clippy" => Clippy { build_compiler: compiler, target } ) ;
16781679 add_component ! ( "miri" => Miri { build_compiler: compiler, target } ) ;
0 commit comments