Skip to content

Commit 984b46c

Browse files
committed
Auto merge of rust-lang#2320 - RalfJung:less-rebuilds, r=RalfJung
reduce regex features to reduce rebuilds Helps with the issue I [mentioned on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/269128-miri/topic/Miri.20rebuilds/near/287442340).
2 parents 2e20cae + 248a10e commit 984b46c

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ libc = "0.2"
3939
[dev-dependencies]
4040
colored = "2"
4141
ui_test = { path = "ui_test" }
42-
regex = "1.5.5"
42+
# Features chosen to match those required by env_logger, to avoid rebuilds
43+
regex = { version = "1.5.5", default-features = false, features = ["perf", "std"] }
4344
lazy_static = "1.4.0"
4445

4546
[package.metadata.rust-analyzer]

ui_test/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ doctest = false # but no doc tests
1010
[dependencies]
1111
rustc_version = "0.4"
1212
colored = "2"
13-
regex = "1.5.5"
13+
# Features chosen to match those required by env_logger, to avoid rebuilds
14+
regex = { version = "1.5.5", default-features = false, features = ["perf", "std"] }
1415
pretty_assertions = "1.2.1"
1516
crossbeam = "0.8.1"
1617
lazy_static = "1.4.0"

ui_test/src/comments.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl Comments {
7575
pub(crate) fn parse(path: &Path, content: &str) -> Self {
7676
let mut this = Self::default();
7777
let error_pattern_regex =
78-
Regex::new(r"//(\[(?P<revision>[^\]]+)\])?~(?P<offset>\||[\^]+)?\s*(?P<level>ERROR|HELP|WARN|NOTE)?:?(?P<text>.*)")
78+
Regex::new(r"//(\[(?P<revision>[^\]]+)\])?~(?P<offset>\||[\^]+)? *(?P<level>ERROR|HELP|WARN|NOTE)?:?(?P<text>.*)")
7979
.unwrap();
8080

8181
// The line that a `|` will refer to

ui_test/src/rustc_stderr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl Span {
116116
}
117117

118118
pub(crate) fn filter_annotations_from_rendered(rendered: &str) -> std::borrow::Cow<'_, str> {
119-
let annotations = Regex::new(r"\s*//(\[[^\]]\])?~.*").unwrap();
119+
let annotations = Regex::new(r" *//(\[[^\]]\])?~.*").unwrap();
120120
annotations.replace_all(rendered, "")
121121
}
122122

0 commit comments

Comments
 (0)