@@ -1560,7 +1560,7 @@ impl Step for CraneliftCodegenBackend {
1560
1560
1561
1561
#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
1562
1562
pub struct Rustfmt {
1563
- pub build_compiler : Compiler ,
1563
+ pub compilers : RustcPrivateCompilers ,
1564
1564
pub target : TargetSelection ,
1565
1565
}
1566
1566
@@ -1576,21 +1576,14 @@ impl Step for Rustfmt {
1576
1576
1577
1577
fn make_run ( run : RunConfig < ' _ > ) {
1578
1578
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 ) ,
1584
1580
target : run. target ,
1585
1581
} ) ;
1586
1582
}
1587
1583
1588
1584
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 ) ) ;
1594
1587
1595
1588
let mut tarball = Tarball :: new ( builder, "rustfmt" , & self . target . triple ) ;
1596
1589
tarball. set_overlay ( OverlayKind :: Rustfmt ) ;
@@ -1600,6 +1593,10 @@ impl Step for Rustfmt {
1600
1593
tarball. add_legal_and_readme_to ( "share/doc/rustfmt" ) ;
1601
1594
Some ( tarball. generate ( ) )
1602
1595
}
1596
+
1597
+ fn metadata ( & self ) -> Option < StepMetadata > {
1598
+ Some ( StepMetadata :: dist ( "rustfmt" , self . target ) . built_by ( self . compilers . build_compiler ( ) ) )
1599
+ }
1603
1600
}
1604
1601
1605
1602
#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
@@ -1666,7 +1663,7 @@ impl Step for Extended {
1666
1663
// Std stage N is documented with compiler stage N
1667
1664
add_component ! ( "rust-json-docs" => JsonDocs { build_compiler: target_compiler, target } ) ;
1668
1665
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 } ) ;
1670
1667
add_component ! ( "rust-analyzer" => RustAnalyzer { compilers: rustc_private_compilers, target } ) ;
1671
1668
add_component ! ( "llvm-components" => LlvmTools { target } ) ;
1672
1669
add_component ! ( "clippy" => Clippy { compilers: rustc_private_compilers, target } ) ;
0 commit comments