Skip to content

Commit 40be047

Browse files
authored
Rollup merge of rust-lang#139520 - jieyouxu:compiletest-maintenance-1, r=lqd
compiletest maintenance: sort deps and drop dep on `anyhow` Two changes: 1. Sort compiletest deps alphabetically because it was annoying me (harder to quickly glance what deps compiletest is using). 2. Drop dependency on `anyhow`. There's only one usage of `anyhow`, which is for `with_context` on sth that would immediately panic anyway.
2 parents b41e2bd + 603685c commit 40be047

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

Cargo.lock

-1
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,6 @@ name = "compiletest"
718718
version = "0.0.0"
719719
dependencies = [
720720
"anstyle-svg",
721-
"anyhow",
722721
"build_helper",
723722
"colored",
724723
"diff",

src/tools/compiletest/Cargo.toml

+9-8
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,26 @@ edition = "2021"
77
doctest = false
88

99
[dependencies]
10+
# tidy-alphabetical-start
1011
anstyle-svg = "0.1.3"
12+
build_helper = { path = "../../build_helper" }
1113
colored = "2"
1214
diff = "0.1.10"
13-
unified-diff = "0.2.1"
1415
getopts = "0.2"
16+
glob = "0.3.0"
17+
home = "0.5.5"
1518
indexmap = "2.0.0"
1619
miropt-test-tools = { path = "../miropt-test-tools" }
17-
build_helper = { path = "../../build_helper" }
18-
tracing = "0.1"
19-
tracing-subscriber = { version = "0.3.3", default-features = false, features = ["ansi", "env-filter", "fmt", "parking_lot", "smallvec"] }
2020
regex = "1.0"
21+
rustfix = "0.8.1"
2122
semver = { version = "1.0.23", features = ["serde"] }
2223
serde = { version = "1.0", features = ["derive"] }
2324
serde_json = "1.0"
24-
rustfix = "0.8.1"
25+
tracing = "0.1"
26+
tracing-subscriber = { version = "0.3.3", default-features = false, features = ["ansi", "env-filter", "fmt", "parking_lot", "smallvec"] }
27+
unified-diff = "0.2.1"
2528
walkdir = "2"
26-
glob = "0.3.0"
27-
anyhow = "1"
28-
home = "0.5.5"
29+
# tidy-alphabetical-end
2930

3031
[target.'cfg(unix)'.dependencies]
3132
libc = "0.2"

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)