Skip to content

Commit e919556

Browse files
authored
[meta] update to Rust 1.87 (#2353)
Consists of illumos posix_spawn fixes in particular.
1 parent 5671f91 commit e919556

File tree

10 files changed

+24
-23
lines changed

10 files changed

+24
-23
lines changed

cargo-nextest/src/double_spawn.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ impl DoubleSpawnOpts {
2929
let mut command = std::process::Command::new(&self.program);
3030
// Note: exec only returns an error -- in the success case it never returns.
3131
let err = command.args(args).exec();
32-
Err(ExpectedError::DoubleSpawnExecError { command, err })
32+
Err(ExpectedError::DoubleSpawnExecError {
33+
command: Box::new(command),
34+
err,
35+
})
3336
}
3437
}

cargo-nextest/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ pub enum ExpectedError {
259259
},
260260
#[error("double-spawn execution error")]
261261
DoubleSpawnExecError {
262-
command: std::process::Command,
262+
command: Box<std::process::Command>,
263263
#[source]
264264
err: std::io::Error,
265265
},

integration-tests/src/nextest_cli.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl CargoNextestCli {
6262
let output = command.output().wrap_err("failed to get current exe")?;
6363

6464
let output = CargoNextestOutput {
65-
command,
65+
command: Box::new(command),
6666
exit_status: output.status,
6767
stdout: output.stdout,
6868
stderr: output.stderr,
@@ -120,7 +120,7 @@ impl CargoNextestCli {
120120
let output = command.output().expect("failed to execute");
121121

122122
let ret = CargoNextestOutput {
123-
command,
123+
command: Box::new(command),
124124
exit_status: output.status,
125125
stdout: output.stdout,
126126
stderr: output.stderr,
@@ -135,7 +135,7 @@ impl CargoNextestCli {
135135
}
136136

137137
pub struct CargoNextestOutput {
138-
pub command: Command,
138+
pub command: Box<Command>,
139139
pub exit_status: ExitStatus,
140140
pub stdout: Vec<u8>,
141141
pub stderr: Vec<u8>,

nextest-runner/src/double_spawn.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ mod imp {
149149
let path = Path::new(PROC_SELF_EXE);
150150
match path.symlink_metadata() {
151151
Ok(_) => Ok(path.to_owned()),
152-
Err(e) if e.kind() == std::io::ErrorKind::NotFound => Err(std::io::Error::new(
153-
std::io::ErrorKind::Other,
152+
Err(e) if e.kind() == std::io::ErrorKind::NotFound => Err(std::io::Error::other(
154153
"no /proc/self/exe available. Is /proc mounted?",
155154
)),
156155
Err(e) => Err(e),

nextest-runner/src/reporter/aggregator/junit.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ mod tests {
574574
errors: ErrorList::new(
575575
"collecting child output",
576576
vec![ChildError::Fd(ChildFdError::Wait(Arc::new(
577-
io::Error::new(io::ErrorKind::Other, "huh"),
577+
io::Error::other("huh"),
578578
)))],
579579
),
580580
},
@@ -608,7 +608,7 @@ mod tests {
608608
errors: ErrorList::new(
609609
"collecting child output",
610610
vec![ChildError::Fd(ChildFdError::ReadStdout(Arc::new(
611-
io::Error::new(io::ErrorKind::Other, "stdout error"),
611+
io::Error::other("stdout error"),
612612
)))],
613613
),
614614
},
@@ -628,7 +628,7 @@ mod tests {
628628
comment: "exec fail + combined + store (exec fail means nothing to store)",
629629
status: TestCaseStatus::non_success(NonSuccessKind::Error),
630630
output: ChildExecutionOutput::StartError(ChildStartError::Spawn(Arc::new(
631-
io::Error::new(io::ErrorKind::Other, "start error"),
631+
io::Error::other("start error"),
632632
))),
633633
store_stdout_stderr: true,
634634
message: Some("error spawning child process"),

nextest-runner/src/reporter/structured/libtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose bac
773773
#[test]
774774
fn strips_human_output_start_error() {
775775
let inner_error = eyre!("inner error");
776-
let error = io::Error::new(io::ErrorKind::Other, inner_error);
776+
let error = io::Error::other(inner_error);
777777

778778
let output = ChildExecutionOutput::StartError(ChildStartError::Spawn(Arc::new(error)));
779779

nextest-runner/src/reuse_build/archiver.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,7 @@ fn find_std(libdir: &Utf8Path) -> io::Result<Utf8PathBuf> {
683683
}
684684
}
685685

686-
Err(io::Error::new(
687-
io::ErrorKind::Other,
686+
Err(io::Error::other(
688687
"could not find the Rust standard library in the libdir",
689688
))
690689
}

nextest-runner/src/runner/dispatcher.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,9 @@ impl ContextTestInstance<'_> {
836836
}
837837
}
838838

839+
// Almost all events are executor events, which is much larger than the others,
840+
// so it doesn't make sense to optimize for the rare signal and input events.
841+
#[expect(clippy::large_enum_variant)]
839842
#[derive(Debug)]
840843
enum InternalEvent<'a> {
841844
Executor(ExecutorEvent<'a>),

nextest-runner/src/update.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -449,15 +449,12 @@ impl MuktiUpdateContext<'_> {
449449
cmd.args(["nextest", "self", "setup", "--source", "self-update"]);
450450
let status = cmd.status().map_err(UpdateError::SelfSetup)?;
451451
if !status.success() {
452-
return Err(UpdateError::SelfSetup(io::Error::new(
453-
io::ErrorKind::Other,
454-
format!(
455-
"`cargo nextest self setup` failed with exit code {}",
456-
status
457-
.code()
458-
.map_or("(unknown)".to_owned(), |c| c.to_string())
459-
),
460-
)));
452+
return Err(UpdateError::SelfSetup(io::Error::other(format!(
453+
"`cargo nextest self setup` failed with exit code {}",
454+
status
455+
.code()
456+
.map_or("(unknown)".to_owned(), |c| c.to_string())
457+
))));
461458
}
462459
}
463460

nextest-runner/src/write_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub trait WriteStr {
6262
if output.error.is_err() {
6363
output.error
6464
} else {
65-
Err(io::Error::new(io::ErrorKind::Other, "formatter error"))
65+
Err(io::Error::other("formatter error"))
6666
}
6767
}
6868
}

0 commit comments

Comments
 (0)