@@ -1551,7 +1551,7 @@ impl Step for CraneliftCodegenBackend {
15511551
15521552#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
15531553pub struct Rustfmt {
1554- pub build_compiler : Compiler ,
1554+ pub compilers : RustcPrivateCompilers ,
15551555 pub target : TargetSelection ,
15561556}
15571557
@@ -1567,21 +1567,14 @@ impl Step for Rustfmt {
15671567
15681568 fn make_run ( run : RunConfig < ' _ > ) {
15691569 run. builder . ensure ( Rustfmt {
1570- build_compiler : run. builder . compiler_for (
1571- run. builder . top_stage ,
1572- run. builder . config . host_target ,
1573- run. target ,
1574- ) ,
1570+ compilers : RustcPrivateCompilers :: new ( run. builder , run. builder . top_stage , run. target ) ,
15751571 target : run. target ,
15761572 } ) ;
15771573 }
15781574
15791575 fn run ( self , builder : & Builder < ' _ > ) -> Option < GeneratedTarball > {
1580- let compilers =
1581- RustcPrivateCompilers :: from_build_compiler ( builder, self . build_compiler , self . target ) ;
1582-
1583- let rustfmt = builder. ensure ( tool:: Rustfmt :: from_compilers ( compilers) ) ;
1584- let cargofmt = builder. ensure ( tool:: Cargofmt :: from_compilers ( compilers) ) ;
1576+ let rustfmt = builder. ensure ( tool:: Rustfmt :: from_compilers ( self . compilers ) ) ;
1577+ let cargofmt = builder. ensure ( tool:: Cargofmt :: from_compilers ( self . compilers ) ) ;
15851578
15861579 let mut tarball = Tarball :: new ( builder, "rustfmt" , & self . target . triple ) ;
15871580 tarball. set_overlay ( OverlayKind :: Rustfmt ) ;
@@ -1591,6 +1584,10 @@ impl Step for Rustfmt {
15911584 tarball. add_legal_and_readme_to ( "share/doc/rustfmt" ) ;
15921585 Some ( tarball. generate ( ) )
15931586 }
1587+
1588+ fn metadata ( & self ) -> Option < StepMetadata > {
1589+ Some ( StepMetadata :: dist ( "rustfmt" , self . target ) . built_by ( self . compilers . build_compiler ( ) ) )
1590+ }
15941591}
15951592
15961593#[ derive( Debug , PartialOrd , Ord , Clone , Hash , PartialEq , Eq ) ]
@@ -1657,7 +1654,7 @@ impl Step for Extended {
16571654 // Std stage N is documented with compiler stage N
16581655 add_component ! ( "rust-json-docs" => JsonDocs { build_compiler: target_compiler, target } ) ;
16591656 add_component ! ( "cargo" => Cargo { build_compiler: compiler, target } ) ;
1660- add_component ! ( "rustfmt" => Rustfmt { build_compiler : compiler , target } ) ;
1657+ add_component ! ( "rustfmt" => Rustfmt { compilers : rustc_private_compilers , target } ) ;
16611658 add_component ! ( "rust-analyzer" => RustAnalyzer { compilers: rustc_private_compilers, target } ) ;
16621659 add_component ! ( "llvm-components" => LlvmTools { target } ) ;
16631660 add_component ! ( "clippy" => Clippy { compilers: rustc_private_compilers, target } ) ;
0 commit comments