Skip to content

Commit 8199c95

Browse files
committed
make mark_as_executed private
1 parent 0a57612 commit 8199c95

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

src/bootstrap/src/utils/exec.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -211,15 +211,6 @@ impl<'a> BootstrapCommand {
211211
exec_ctx.as_ref().start(self, OutputMode::Capture, OutputMode::Print)
212212
}
213213

214-
/// Spawn the command in background, while capturing and returns a handle to stream the output.
215-
#[track_caller]
216-
pub fn stream_capture(
217-
&'a mut self,
218-
exec_ctx: impl AsRef<ExecutionContext>,
219-
) -> Option<StreamingCommand> {
220-
exec_ctx.as_ref().stream(self, OutputMode::Capture, OutputMode::Capture)
221-
}
222-
223214
/// Spawn the command in background, while capturing and returning stdout, and printing stderr.
224215
/// Returns None in dry-mode
225216
#[track_caller]
@@ -232,7 +223,7 @@ impl<'a> BootstrapCommand {
232223

233224
/// Mark the command as being executed, disarming the drop bomb.
234225
/// If this method is not called before the command is dropped, its drop will panic.
235-
pub fn mark_as_executed(&mut self) {
226+
fn mark_as_executed(&mut self) {
236227
self.drop_bomb.defuse();
237228
}
238229

@@ -664,7 +655,7 @@ impl ExecutionContext {
664655

665656
let stdout = child.stdout.take();
666657
let stderr = child.stderr.take();
667-
return Some(StreamingCommand { child, stdout, stderr });
658+
Some(StreamingCommand { child, stdout, stderr })
668659
}
669660
}
670661

src/bootstrap/src/utils/render_tests.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ pub(crate) fn try_run_tests(
3434
cmd: &mut BootstrapCommand,
3535
stream: bool,
3636
) -> bool {
37-
if builder.config.dry_run() {
38-
cmd.mark_as_executed();
39-
return true;
40-
}
41-
4237
if !run_tests(builder, cmd, stream) {
4338
if builder.fail_fast {
4439
crate::exit!(1);
@@ -54,7 +49,9 @@ pub(crate) fn try_run_tests(
5449
fn run_tests(builder: &Builder<'_>, cmd: &mut BootstrapCommand, stream: bool) -> bool {
5550
builder.verbose(|| println!("running: {cmd:?}"));
5651

57-
let mut streaming_command = cmd.stream_capture_stdout(&builder.config.exec_ctx).unwrap();
52+
let Some(mut streaming_command) = cmd.stream_capture_stdout(&builder.config.exec_ctx) else {
53+
return true;
54+
};
5855

5956
// This runs until the stdout of the child is closed, which means the child exited. We don't
6057
// run this on another thread since the builder is not Sync.

0 commit comments

Comments
 (0)