Skip to content

Commit 7e8e022

Browse files
authored
Unrolled build for #145560
Rollup merge of #145560 - Kobzol:bootstrap-remove-ord, r=jieyouxu Remove unused `PartialOrd`/`Ord` from bootstrap It was just wasting compile-time. There is one remaining "old" bootstrap test that uses the `Ord` impl on one test step, I'll remove that later.
2 parents 05f5a58 + e31aea8 commit 7e8e022

File tree

8 files changed

+34
-34
lines changed

8 files changed

+34
-34
lines changed

src/bootstrap/src/core/build_steps/compile.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ use crate::{
3939
};
4040

4141
/// Build a standard library for the given `target` using the given `build_compiler`.
42-
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
42+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
4343
pub struct Std {
4444
pub target: TargetSelection,
4545
/// Compiler that builds the standard library.
@@ -949,7 +949,7 @@ pub struct BuiltRustc {
949949
/// so that it can compile build scripts and proc macros when building this `rustc`.
950950
/// - Makes sure that `build_compiler` has a standard library prepared for `target`,
951951
/// so that the built `rustc` can *link to it* and use it at runtime.
952-
#[derive(Debug, PartialOrd, Ord, Clone, PartialEq, Eq, Hash)]
952+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
953953
pub struct Rustc {
954954
/// The target on which rustc will run (its host).
955955
pub target: TargetSelection,
@@ -1960,7 +1960,7 @@ impl Step for Sysroot {
19601960
/// linker wrappers (LLD, LLVM bitcode linker, etc.).
19611961
///
19621962
/// This will assemble a compiler in `build/$target/stage$stage`.
1963-
#[derive(Debug, PartialOrd, Ord, Clone, PartialEq, Eq, Hash)]
1963+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
19641964
pub struct Assemble {
19651965
/// The compiler which we will produce in this step. Assemble itself will
19661966
/// take care of ensuring that the necessary prerequisites to do so exist,

src/bootstrap/src/core/build_steps/dist.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fn should_build_extended_tool(builder: &Builder<'_>, tool: &str) -> bool {
5454
builder.config.tools.as_ref().is_none_or(|tools| tools.contains(tool))
5555
}
5656

57-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
57+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
5858
pub struct Docs {
5959
pub host: TargetSelection,
6060
}
@@ -91,7 +91,7 @@ impl Step for Docs {
9191
}
9292
}
9393

94-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
94+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
9595
pub struct JsonDocs {
9696
build_compiler: Compiler,
9797
target: TargetSelection,
@@ -354,7 +354,7 @@ fn get_cc_search_dirs(
354354
(bin_path, lib_path)
355355
}
356356

357-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
357+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
358358
pub struct Mingw {
359359
pub host: TargetSelection,
360360
}
@@ -394,7 +394,7 @@ impl Step for Mingw {
394394
}
395395
}
396396

397-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
397+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
398398
pub struct Rustc {
399399
pub compiler: Compiler,
400400
}
@@ -730,7 +730,7 @@ fn copy_target_libs(
730730
}
731731
}
732732

733-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
733+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
734734
pub struct Std {
735735
pub compiler: Compiler,
736736
pub target: TargetSelection,
@@ -785,7 +785,7 @@ impl Step for Std {
785785
/// `rust.download-rustc`.
786786
///
787787
/// (Don't confuse this with [`RustDev`], without the `c`!)
788-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
788+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
789789
pub struct RustcDev {
790790
pub compiler: Compiler,
791791
pub target: TargetSelection,
@@ -1026,7 +1026,7 @@ fn copy_src_dirs(
10261026
}
10271027
}
10281028

1029-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
1029+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
10301030
pub struct Src;
10311031

10321032
impl Step for Src {
@@ -1087,7 +1087,7 @@ impl Step for Src {
10871087
}
10881088
}
10891089

1090-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
1090+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
10911091
pub struct PlainSourceTarball;
10921092

10931093
impl Step for PlainSourceTarball {
@@ -1233,7 +1233,7 @@ impl Step for PlainSourceTarball {
12331233
}
12341234
}
12351235

1236-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
1236+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
12371237
pub struct Cargo {
12381238
pub build_compiler: Compiler,
12391239
pub target: TargetSelection,
@@ -1287,7 +1287,7 @@ impl Step for Cargo {
12871287
}
12881288
}
12891289

1290-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
1290+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
12911291
pub struct RustAnalyzer {
12921292
pub build_compiler: Compiler,
12931293
pub target: TargetSelection,
@@ -1563,7 +1563,7 @@ impl Step for Rustfmt {
15631563
}
15641564
}
15651565

1566-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
1566+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
15671567
pub struct Extended {
15681568
stage: u32,
15691569
host: TargetSelection,
@@ -2404,7 +2404,7 @@ impl Step for LlvmTools {
24042404

24052405
/// Distributes the `llvm-bitcode-linker` tool so that it can be used by a compiler whose host
24062406
/// is `target`.
2407-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
2407+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
24082408
pub struct LlvmBitcodeLinker {
24092409
/// The linker will be compiled by this compiler.
24102410
pub build_compiler: Compiler,

src/bootstrap/src/core/build_steps/doc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ impl Step for SharedAssets {
580580
}
581581

582582
/// Document the standard library using `build_compiler`.
583-
#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
583+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
584584
pub struct Std {
585585
build_compiler: Compiler,
586586
target: TargetSelection,
@@ -715,7 +715,7 @@ impl Step for Std {
715715
/// or remote link.
716716
const STD_PUBLIC_CRATES: [&str; 5] = ["core", "alloc", "std", "proc_macro", "test"];
717717

718-
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
718+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
719719
pub enum DocumentationFormat {
720720
Html,
721721
Json,
@@ -1230,7 +1230,7 @@ fn symlink_dir_force(config: &Config, original: &Path, link: &Path) {
12301230
}
12311231

12321232
/// Builds the Rust compiler book.
1233-
#[derive(Ord, PartialOrd, Debug, Clone, Hash, PartialEq, Eq)]
1233+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
12341234
pub struct RustcBook {
12351235
build_compiler: Compiler,
12361236
target: TargetSelection,
@@ -1334,7 +1334,7 @@ impl Step for RustcBook {
13341334
/// Documents the reference.
13351335
/// It has to always be done using a stage 1+ compiler, because it references in-tree
13361336
/// compiler/stdlib concepts.
1337-
#[derive(Ord, PartialOrd, Debug, Clone, Hash, PartialEq, Eq)]
1337+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
13381338
pub struct Reference {
13391339
build_compiler: Compiler,
13401340
target: TargetSelection,

src/bootstrap/src/core/build_steps/run.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::core::config::flags::get_completion;
1717
use crate::utils::exec::command;
1818
use crate::{Mode, t};
1919

20-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
20+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
2121
pub struct BuildManifest;
2222

2323
impl Step for BuildManifest {
@@ -56,7 +56,7 @@ impl Step for BuildManifest {
5656
}
5757
}
5858

59-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
59+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
6060
pub struct BumpStage0;
6161

6262
impl Step for BumpStage0 {
@@ -78,7 +78,7 @@ impl Step for BumpStage0 {
7878
}
7979
}
8080

81-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
81+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
8282
pub struct ReplaceVersionPlaceholder;
8383

8484
impl Step for ReplaceVersionPlaceholder {
@@ -169,7 +169,7 @@ impl Step for Miri {
169169
}
170170
}
171171

172-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
172+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
173173
pub struct CollectLicenseMetadata;
174174

175175
impl Step for CollectLicenseMetadata {
@@ -200,7 +200,7 @@ impl Step for CollectLicenseMetadata {
200200
}
201201
}
202202

203-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
203+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
204204
pub struct GenerateCopyright;
205205

206206
impl Step for GenerateCopyright {
@@ -264,7 +264,7 @@ impl Step for GenerateCopyright {
264264
}
265265
}
266266

267-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
267+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
268268
pub struct GenerateWindowsSys;
269269

270270
impl Step for GenerateWindowsSys {
@@ -326,7 +326,7 @@ impl Step for GenerateCompletions {
326326
}
327327
}
328328

329-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
329+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
330330
pub struct UnicodeTableGenerator;
331331

332332
impl Step for UnicodeTableGenerator {
@@ -348,7 +348,7 @@ impl Step for UnicodeTableGenerator {
348348
}
349349
}
350350

351-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
351+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
352352
pub struct FeaturesStatusDump;
353353

354354
impl Step for FeaturesStatusDump {
@@ -408,7 +408,7 @@ impl Step for CyclicStep {
408408
///
409409
/// The coverage-dump tool is an internal detail of coverage tests, so this run
410410
/// step is only needed when testing coverage-dump manually.
411-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
411+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
412412
pub struct CoverageDump;
413413

414414
impl Step for CoverageDump {

src/bootstrap/src/core/build_steps/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2732,7 +2732,7 @@ fn prepare_cargo_test(
27322732
/// FIXME(Zalathar): Try to split this into two separate steps: a user-visible
27332733
/// step for testing standard library crates, and an internal step used for both
27342734
/// library crates and compiler crates.
2735-
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2735+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
27362736
pub struct Crate {
27372737
pub compiler: Compiler,
27382738
pub target: TargetSelection,
@@ -3747,7 +3747,7 @@ impl Step for TestFloatParse {
37473747
/// Runs the tool `src/tools/collect-license-metadata` in `ONLY_CHECK=1` mode,
37483748
/// which verifies that `license-metadata.json` is up-to-date and therefore
37493749
/// running the tool normally would not update anything.
3750-
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
3750+
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
37513751
pub struct CollectLicenseMetadata;
37523752

37533753
impl Step for CollectLicenseMetadata {

src/bootstrap/src/core/config/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ impl FromStr for LlvmLibunwind {
324324
}
325325
}
326326

327-
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
327+
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Hash)]
328328
pub enum SplitDebuginfo {
329329
Packed,
330330
Unpacked,

src/bootstrap/src/core/config/target_selection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub struct TargetSelection {
1414
}
1515

1616
/// Newtype over `Vec<TargetSelection>` so we can implement custom parsing logic
17-
#[derive(Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
17+
#[derive(Clone, Default, PartialEq, Eq, Hash, Debug)]
1818
pub struct TargetSelectionList(pub Vec<TargetSelection>);
1919

2020
pub fn target_selection_list(s: &str) -> Result<TargetSelectionList, String> {

src/bootstrap/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ pub enum DependencyType {
279279
///
280280
/// These entries currently correspond to the various output directories of the
281281
/// build system, with each mod generating output in a different directory.
282-
#[derive(Debug, Hash, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
282+
#[derive(Debug, Hash, Clone, Copy, PartialEq, Eq)]
283283
pub enum Mode {
284284
/// Build the standard library, placing output in the "stageN-std" directory.
285285
Std,
@@ -357,7 +357,7 @@ pub enum RemapScheme {
357357
NonCompiler,
358358
}
359359

360-
#[derive(Debug, Hash, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
360+
#[derive(Debug, Hash, Clone, Copy, PartialEq, Eq)]
361361
pub enum CLang {
362362
C,
363363
Cxx,

0 commit comments

Comments
 (0)