Skip to content

Commit 603685c

Browse files
committed
compiletest: drop dependency on anyhow
Currently `compiletest` panics all over the place but doesn't really use `anyhow` anyway. I'd like to introduce some more principled error handling and disciplined diagnostic reporting in the near future.
1 parent 3dec37f commit 603685c

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

Cargo.lock

-1
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,6 @@ name = "compiletest"
676676
version = "0.0.0"
677677
dependencies = [
678678
"anstyle-svg",
679-
"anyhow",
680679
"build_helper",
681680
"colored",
682681
"diff",

src/tools/compiletest/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ doctest = false
99
[dependencies]
1010
# tidy-alphabetical-start
1111
anstyle-svg = "0.1.3"
12-
anyhow = "1"
1312
build_helper = { path = "../../build_helper" }
1413
colored = "2"
1514
diff = "0.1.10"

src/tools/compiletest/src/runtest.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use std::process::{Child, Command, ExitStatus, Output, Stdio};
1010
use std::sync::Arc;
1111
use std::{env, iter, str};
1212

13-
use anyhow::Context;
1413
use colored::Colorize;
1514
use regex::{Captures, Regex};
1615
use tracing::*;
@@ -143,11 +142,11 @@ pub fn run(config: Arc<Config>, testpaths: &TestPaths, revision: Option<&str>) {
143142
}
144143

145144
let cx = TestCx { config: &config, props: &props, testpaths, revision };
146-
create_dir_all(&cx.output_base_dir())
147-
.with_context(|| {
148-
format!("failed to create output base directory {}", cx.output_base_dir().display())
149-
})
150-
.unwrap();
145+
146+
if let Err(e) = create_dir_all(&cx.output_base_dir()) {
147+
panic!("failed to create output base directory {}: {e}", cx.output_base_dir().display());
148+
}
149+
151150
if props.incremental {
152151
cx.init_incremental_test();
153152
}

0 commit comments

Comments
 (0)