Skip to content

Commit 294d90d

Browse files
authored
Unrolled build for rust-lang#138389
Rollup merge of rust-lang#138389 - onur-ozkan:use-expect, r=jieyouxu use `expect` instead of `allow` This is more useful than `allow` as compiler will force us to remove rules that are no longer valid (we already got a few of them in this change).
2 parents 523c507 + 675ae1a commit 294d90d

File tree

10 files changed

+13
-16
lines changed

10 files changed

+13
-16
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl Std {
6767
self
6868
}
6969

70-
#[allow(clippy::wrong_self_convention)]
70+
#[expect(clippy::wrong_self_convention)]
7171
pub fn is_for_mir_opt_tests(mut self, is_for_mir_opt_tests: bool) -> Self {
7272
self.is_for_mir_opt_tests = is_for_mir_opt_tests;
7373
self

src/bootstrap/src/core/build_steps/suggest.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! Attempt to magically identify good tests to run
22
3-
#![cfg_attr(feature = "build-metrics", allow(unused))]
4-
53
use std::path::PathBuf;
64
use std::str::FromStr;
75

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -3377,7 +3377,7 @@ impl Step for CodegenCranelift {
33773377
/*
33783378
let mut prepare_cargo = build_cargo();
33793379
prepare_cargo.arg("--").arg("prepare").arg("--download-dir").arg(&download_dir);
3380-
#[allow(deprecated)]
3380+
#[expect(deprecated)]
33813381
builder.config.try_run(&mut prepare_cargo.into()).unwrap();
33823382
*/
33833383

@@ -3508,7 +3508,7 @@ impl Step for CodegenGCC {
35083508
/*
35093509
let mut prepare_cargo = build_cargo();
35103510
prepare_cargo.arg("--").arg("prepare");
3511-
#[allow(deprecated)]
3511+
#[expect(deprecated)]
35123512
builder.config.try_run(&mut prepare_cargo.into()).unwrap();
35133513
*/
35143514

src/bootstrap/src/core/build_steps/tool.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ impl Step for ToolBuild {
209209
}
210210
}
211211

212-
#[allow(clippy::too_many_arguments)] // FIXME: reduce the number of args and remove this.
212+
#[expect(clippy::too_many_arguments)] // FIXME: reduce the number of args and remove this.
213213
pub fn prepare_tool_cargo(
214214
builder: &Builder<'_>,
215215
compiler: Compiler,
@@ -1024,7 +1024,7 @@ pub struct LibcxxVersionTool {
10241024
pub target: TargetSelection,
10251025
}
10261026

1027-
#[allow(dead_code)]
1027+
#[expect(dead_code)]
10281028
#[derive(Debug, Clone)]
10291029
pub enum LibcxxVersion {
10301030
Gnu(usize),

src/bootstrap/src/core/builder/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,6 @@ impl<'a> Builder<'a> {
12851285
host: TargetSelection,
12861286
target: TargetSelection,
12871287
) -> Compiler {
1288-
#![allow(clippy::let_and_return)]
12891288
let mut resolved_compiler = if self.build.force_use_stage2(stage) {
12901289
trace!(target: "COMPILER_FOR", ?stage, "force_use_stage2");
12911290
self.compiler(2, self.config.build)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[allow(clippy::module_inception)]
1+
#[expect(clippy::module_inception)]
22
mod config;
33
pub mod flags;
44
#[cfg(test)]

src/bootstrap/src/core/download.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ static SHOULD_FIX_BINS_AND_DYLIBS: OnceLock<bool> = OnceLock::new();
1919

2020
/// `Config::try_run` wrapper for this module to avoid warnings on `try_run`, since we don't have access to a `builder` yet.
2121
fn try_run(config: &Config, cmd: &mut Command) -> Result<(), ()> {
22-
#[allow(deprecated)]
22+
#[expect(deprecated)]
2323
config.try_run(cmd)
2424
}
2525

src/bootstrap/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const LLD_FILE_NAMES: &[&str] = &["ld.lld", "ld64.lld", "lld-link", "wasm-ld"];
7474

7575
/// Extra `--check-cfg` to add when building the compiler or tools
7676
/// (Mode restriction, config name, config values (if any))
77-
#[allow(clippy::type_complexity)] // It's fine for hard-coded list and type is explained above.
77+
#[expect(clippy::type_complexity)] // It's fine for hard-coded list and type is explained above.
7878
const EXTRA_CHECK_CFGS: &[(Option<Mode>, &str, Option<&[&'static str]>)] = &[
7979
(None, "bootstrap", None),
8080
(Some(Mode::Rustc), "llvm_enzyme", None),

src/bootstrap/src/utils/exec.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl BootstrapCommand {
125125
Self { failure_behavior: BehaviorOnFailure::DelayFail, ..self }
126126
}
127127

128-
#[allow(dead_code)]
128+
#[expect(dead_code)]
129129
pub fn fail_fast(self) -> Self {
130130
Self { failure_behavior: BehaviorOnFailure::Exit, ..self }
131131
}
@@ -280,7 +280,7 @@ impl CommandOutput {
280280
!self.is_success()
281281
}
282282

283-
#[allow(dead_code)]
283+
#[expect(dead_code)]
284284
pub fn status(&self) -> Option<ExitStatus> {
285285
match self.status {
286286
CommandStatus::Finished(status) => Some(status),
@@ -332,7 +332,6 @@ impl Default for CommandOutput {
332332

333333
/// Helper trait to format both Command and BootstrapCommand as a short execution line,
334334
/// without all the other details (e.g. environment variables).
335-
#[allow(unused)]
336335
pub trait FormatShortCmd {
337336
fn format_short_cmd(&self) -> String;
338337
}

src/bootstrap/src/utils/metrics.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl BuildMetrics {
7676

7777
// Consider all the stats gathered so far as the parent's.
7878
if !state.running_steps.is_empty() {
79-
self.collect_stats(&mut *state);
79+
self.collect_stats(&mut state);
8080
}
8181

8282
state.system_info.refresh_cpu_usage();
@@ -102,7 +102,7 @@ impl BuildMetrics {
102102

103103
let mut state = self.state.borrow_mut();
104104

105-
self.collect_stats(&mut *state);
105+
self.collect_stats(&mut state);
106106

107107
let step = state.running_steps.pop().unwrap();
108108
if state.running_steps.is_empty() {
@@ -224,6 +224,7 @@ impl BuildMetrics {
224224
t!(serde_json::to_writer(&mut file, &json));
225225
}
226226

227+
#[expect(clippy::only_used_in_recursion)]
227228
fn prepare_json_step(&self, step: StepMetrics) -> JsonNode {
228229
let mut children = Vec::new();
229230
children.extend(step.children.into_iter().map(|child| self.prepare_json_step(child)));

0 commit comments

Comments
 (0)