From e76c484d6d06129203cc71c99e5c1a5ff9ee26e8 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Wed, 1 Jan 2025 23:30:50 +1100 Subject: [PATCH] Remove the unused `extra_features` field from `tool_extended!` This field was introduced in #48097 to support the "clippy" feature of RLS. --- src/bootstrap/src/core/build_steps/dist.rs | 18 ++++++--------- src/bootstrap/src/core/build_steps/test.rs | 16 ++++--------- src/bootstrap/src/core/build_steps/tool.rs | 4 +--- src/bootstrap/src/core/builder/mod.rs | 26 +++++----------------- 4 files changed, 18 insertions(+), 46 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index 89b2d73f74a..8bfa9cc94b3 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -1152,7 +1152,7 @@ impl Step for Rls { let compiler = self.compiler; let target = self.target; - let rls = builder.ensure(tool::Rls { compiler, target, extra_features: Vec::new() }); + let rls = builder.ensure(tool::Rls { compiler, target }); let mut tarball = Tarball::new(builder, "rls", &target.triple); tarball.set_overlay(OverlayKind::Rls); @@ -1239,9 +1239,8 @@ impl Step for Clippy { // Prepare the image directory // We expect clippy to build, because we've exited this step above if tool // state for clippy isn't testing. - let clippy = builder.ensure(tool::Clippy { compiler, target, extra_features: Vec::new() }); - let cargoclippy = - builder.ensure(tool::CargoClippy { compiler, target, extra_features: Vec::new() }); + let clippy = builder.ensure(tool::Clippy { compiler, target }); + let cargoclippy = builder.ensure(tool::CargoClippy { compiler, target }); let mut tarball = Tarball::new(builder, "clippy", &target.triple); tarball.set_overlay(OverlayKind::Clippy); @@ -1290,9 +1289,8 @@ impl Step for Miri { let compiler = self.compiler; let target = self.target; - let miri = builder.ensure(tool::Miri { compiler, target, extra_features: Vec::new() }); - let cargomiri = - builder.ensure(tool::CargoMiri { compiler, target, extra_features: Vec::new() }); + let miri = builder.ensure(tool::Miri { compiler, target }); + let cargomiri = builder.ensure(tool::CargoMiri { compiler, target }); let mut tarball = Tarball::new(builder, "miri", &target.triple); tarball.set_overlay(OverlayKind::Miri); @@ -1423,10 +1421,8 @@ impl Step for Rustfmt { let compiler = self.compiler; let target = self.target; - let rustfmt = - builder.ensure(tool::Rustfmt { compiler, target, extra_features: Vec::new() }); - let cargofmt = - builder.ensure(tool::Cargofmt { compiler, target, extra_features: Vec::new() }); + let rustfmt = builder.ensure(tool::Rustfmt { compiler, target }); + let cargofmt = builder.ensure(tool::Cargofmt { compiler, target }); let mut tarball = Tarball::new(builder, "rustfmt", &target.triple); tarball.set_overlay(OverlayKind::Rustfmt); tarball.is_preview(true); diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 9312ff4c27a..84d09bbc2e0 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -409,7 +409,7 @@ impl Step for Rustfmt { let host = self.host; let compiler = builder.compiler(stage, host); - builder.ensure(tool::Rustfmt { compiler, target: self.host, extra_features: Vec::new() }); + builder.ensure(tool::Rustfmt { compiler, target: self.host }); let mut cargo = tool::prepare_tool_cargo( builder, @@ -511,17 +511,9 @@ impl Step for Miri { let host_compiler = builder.compiler(stage - 1, host); // Build our tools. - let miri = builder.ensure(tool::Miri { - compiler: host_compiler, - target: host, - extra_features: Vec::new(), - }); + let miri = builder.ensure(tool::Miri { compiler: host_compiler, target: host }); // the ui tests also assume cargo-miri has been built - builder.ensure(tool::CargoMiri { - compiler: host_compiler, - target: host, - extra_features: Vec::new(), - }); + builder.ensure(tool::CargoMiri { compiler: host_compiler, target: host }); // We also need sysroots, for Miri and for the host (the latter for build scripts). // This is for the tests so everything is done with the target compiler. @@ -740,7 +732,7 @@ impl Step for Clippy { let host = self.host; let compiler = builder.compiler(stage, host); - builder.ensure(tool::Clippy { compiler, target: self.host, extra_features: Vec::new() }); + builder.ensure(tool::Clippy { compiler, target: self.host }); let mut cargo = tool::prepare_tool_cargo( builder, compiler, diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs index 6b809a52bd2..9883795c1fc 100644 --- a/src/bootstrap/src/core/build_steps/tool.rs +++ b/src/bootstrap/src/core/build_steps/tool.rs @@ -1021,7 +1021,6 @@ macro_rules! tool_extended { pub struct $name { pub compiler: Compiler, pub target: TargetSelection, - pub extra_features: Vec, } impl Step for $name { @@ -1051,7 +1050,6 @@ macro_rules! tool_extended { run.builder.ensure($name { compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build), target: run.target, - extra_features: Vec::new(), }); } @@ -1063,7 +1061,7 @@ macro_rules! tool_extended { tool: $tool_name, mode: if false $(|| $tool_std)? { Mode::ToolStd } else { Mode::ToolRustc }, path: $path, - extra_features: $sel.extra_features, + extra_features: vec![], source_type: SourceType::InTree, allow_features: concat!($($allow_features)*), cargo_args: vec![] diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs index c3a74683cd3..ee056ea06cb 100644 --- a/src/bootstrap/src/core/builder/mod.rs +++ b/src/bootstrap/src/core/builder/mod.rs @@ -1339,16 +1339,9 @@ impl<'a> Builder<'a> { } let build_compiler = self.compiler(run_compiler.stage - 1, self.build.build); - self.ensure(tool::Clippy { - compiler: build_compiler, - target: self.build.build, - extra_features: vec![], - }); - let cargo_clippy = self.ensure(tool::CargoClippy { - compiler: build_compiler, - target: self.build.build, - extra_features: vec![], - }); + self.ensure(tool::Clippy { compiler: build_compiler, target: self.build.build }); + let cargo_clippy = + self.ensure(tool::CargoClippy { compiler: build_compiler, target: self.build.build }); let mut dylib_path = helpers::dylib_path(); dylib_path.insert(0, self.sysroot(run_compiler).join("lib")); @@ -1363,16 +1356,9 @@ impl<'a> Builder<'a> { let build_compiler = self.compiler(run_compiler.stage - 1, self.build.build); // Prepare the tools - let miri = self.ensure(tool::Miri { - compiler: build_compiler, - target: self.build.build, - extra_features: Vec::new(), - }); - let cargo_miri = self.ensure(tool::CargoMiri { - compiler: build_compiler, - target: self.build.build, - extra_features: Vec::new(), - }); + let miri = self.ensure(tool::Miri { compiler: build_compiler, target: self.build.build }); + let cargo_miri = + self.ensure(tool::CargoMiri { compiler: build_compiler, target: self.build.build }); // Invoke cargo-miri, make sure it can find miri and cargo. let mut cmd = command(cargo_miri); cmd.env("MIRI", &miri);