@@ -1560,7 +1560,7 @@ impl Step for CraneliftCodegenBackend {
15601560
15611561#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
15621562pub struct Rustfmt {
1563- pub build_compiler : Compiler ,
1563+ pub compilers : RustcPrivateCompilers ,
15641564 pub target : TargetSelection ,
15651565}
15661566
@@ -1576,21 +1576,14 @@ impl Step for Rustfmt {
15761576
15771577 fn make_run ( run : RunConfig < ' _ > ) {
15781578 run. builder . ensure ( Rustfmt {
1579- build_compiler : run. builder . compiler_for (
1580- run. builder . top_stage ,
1581- run. builder . config . host_target ,
1582- run. target ,
1583- ) ,
1579+ compilers : RustcPrivateCompilers :: new ( run. builder , run. builder . top_stage , run. target ) ,
15841580 target : run. target ,
15851581 } ) ;
15861582 }
15871583
15881584 fn run ( self , builder : & Builder < ' _ > ) -> Option < GeneratedTarball > {
1589- let compilers =
1590- RustcPrivateCompilers :: from_build_compiler ( builder, self . build_compiler , self . target ) ;
1591-
1592- let rustfmt = builder. ensure ( tool:: Rustfmt :: from_compilers ( compilers) ) ;
1593- let cargofmt = builder. ensure ( tool:: Cargofmt :: from_compilers ( compilers) ) ;
1585+ let rustfmt = builder. ensure ( tool:: Rustfmt :: from_compilers ( self . compilers ) ) ;
1586+ let cargofmt = builder. ensure ( tool:: Cargofmt :: from_compilers ( self . compilers ) ) ;
15941587
15951588 let mut tarball = Tarball :: new ( builder, "rustfmt" , & self . target . triple ) ;
15961589 tarball. set_overlay ( OverlayKind :: Rustfmt ) ;
@@ -1600,6 +1593,10 @@ impl Step for Rustfmt {
16001593 tarball. add_legal_and_readme_to ( "share/doc/rustfmt" ) ;
16011594 Some ( tarball. generate ( ) )
16021595 }
1596+
1597+ fn metadata ( & self ) -> Option < StepMetadata > {
1598+ Some ( StepMetadata :: dist ( "rustfmt" , self . target ) . built_by ( self . compilers . build_compiler ( ) ) )
1599+ }
16031600}
16041601
16051602#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
@@ -1666,7 +1663,7 @@ impl Step for Extended {
16661663 // Std stage N is documented with compiler stage N
16671664 add_component ! ( "rust-json-docs" => JsonDocs { build_compiler: target_compiler, target } ) ;
16681665 add_component ! ( "cargo" => Cargo { build_compiler: compiler, target } ) ;
1669- add_component ! ( "rustfmt" => Rustfmt { build_compiler : compiler , target } ) ;
1666+ add_component ! ( "rustfmt" => Rustfmt { compilers : rustc_private_compilers , target } ) ;
16701667 add_component ! ( "rust-analyzer" => RustAnalyzer { compilers: rustc_private_compilers, target } ) ;
16711668 add_component ! ( "llvm-components" => LlvmTools { target } ) ;
16721669 add_component ! ( "clippy" => Clippy { compilers: rustc_private_compilers, target } ) ;
0 commit comments