@@ -1268,7 +1268,7 @@ impl Step for PlainSourceTarball {
12681268 }
12691269}
12701270
1271- #[ derive( Debug , PartialOrd , Ord , Clone , Hash , PartialEq , Eq ) ]
1271+ #[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
12721272pub struct Cargo {
12731273 pub build_compiler : Compiler ,
12741274 pub target : TargetSelection ,
@@ -1325,9 +1325,10 @@ impl Step for Cargo {
13251325 }
13261326}
13271327
1328- #[ derive( Debug , PartialOrd , Ord , Clone , Hash , PartialEq , Eq ) ]
1328+ /// Distribute the rust-analyzer component, which is used as a LSP by various IDEs.
1329+ #[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
13291330pub struct RustAnalyzer {
1330- pub build_compiler : Compiler ,
1331+ pub compilers : RustcPrivateCompilers ,
13311332 pub target : TargetSelection ,
13321333}
13331334
@@ -1343,21 +1344,14 @@ impl Step for RustAnalyzer {
13431344
13441345 fn make_run ( run : RunConfig < ' _ > ) {
13451346 run. builder . ensure ( RustAnalyzer {
1346- build_compiler : run. builder . compiler_for (
1347- run. builder . top_stage ,
1348- run. builder . config . host_target ,
1349- run. target ,
1350- ) ,
1347+ compilers : RustcPrivateCompilers :: new ( run. builder , run. builder . top_stage , run. target ) ,
13511348 target : run. target ,
13521349 } ) ;
13531350 }
13541351
13551352 fn run ( self , builder : & Builder < ' _ > ) -> Option < GeneratedTarball > {
13561353 let target = self . target ;
1357- let compilers =
1358- RustcPrivateCompilers :: from_build_compiler ( builder, self . build_compiler , self . target ) ;
1359-
1360- let rust_analyzer = builder. ensure ( tool:: RustAnalyzer :: from_compilers ( compilers) ) ;
1354+ let rust_analyzer = builder. ensure ( tool:: RustAnalyzer :: from_compilers ( self . compilers ) ) ;
13611355
13621356 let mut tarball = Tarball :: new ( builder, "rust-analyzer" , & target. triple ) ;
13631357 tarball. set_overlay ( OverlayKind :: RustAnalyzer ) ;
@@ -1366,6 +1360,13 @@ impl Step for RustAnalyzer {
13661360 tarball. add_legal_and_readme_to ( "share/doc/rust-analyzer" ) ;
13671361 Some ( tarball. generate ( ) )
13681362 }
1363+
1364+ fn metadata ( & self ) -> Option < StepMetadata > {
1365+ Some (
1366+ StepMetadata :: dist ( "rust-analyzer" , self . target )
1367+ . built_by ( self . compilers . build_compiler ( ) ) ,
1368+ )
1369+ }
13691370}
13701371
13711372#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
@@ -1663,7 +1664,7 @@ impl Step for Extended {
16631664 add_component ! ( "rust-json-docs" => JsonDocs { build_compiler: target_compiler, target } ) ;
16641665 add_component ! ( "cargo" => Cargo { build_compiler: compiler, target } ) ;
16651666 add_component ! ( "rustfmt" => Rustfmt { build_compiler: compiler, target } ) ;
1666- add_component ! ( "rust-analyzer" => RustAnalyzer { build_compiler : compiler, target } ) ;
1667+ add_component ! ( "rust-analyzer" => RustAnalyzer { compilers : RustcPrivateCompilers :: from_build_compiler ( builder , compiler, target ) , target } ) ;
16671668 add_component ! ( "llvm-components" => LlvmTools { target } ) ;
16681669 add_component ! ( "clippy" => Clippy { build_compiler: compiler, target } ) ;
16691670 add_component ! ( "miri" => Miri { build_compiler: compiler, target } ) ;
0 commit comments