Auto merge of #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).
This commit is contained in:
commit
984b46cc7d
@ -39,7 +39,8 @@ libc = "0.2"
|
||||
[dev-dependencies]
|
||||
colored = "2"
|
||||
ui_test = { path = "ui_test" }
|
||||
regex = "1.5.5"
|
||||
# Features chosen to match those required by env_logger, to avoid rebuilds
|
||||
regex = { version = "1.5.5", default-features = false, features = ["perf", "std"] }
|
||||
lazy_static = "1.4.0"
|
||||
|
||||
[package.metadata.rust-analyzer]
|
||||
|
@ -10,7 +10,8 @@ doctest = false # but no doc tests
|
||||
[dependencies]
|
||||
rustc_version = "0.4"
|
||||
colored = "2"
|
||||
regex = "1.5.5"
|
||||
# Features chosen to match those required by env_logger, to avoid rebuilds
|
||||
regex = { version = "1.5.5", default-features = false, features = ["perf", "std"] }
|
||||
pretty_assertions = "1.2.1"
|
||||
crossbeam = "0.8.1"
|
||||
lazy_static = "1.4.0"
|
||||
|
@ -75,7 +75,7 @@ pub(crate) fn parse_file(path: &Path) -> Self {
|
||||
pub(crate) fn parse(path: &Path, content: &str) -> Self {
|
||||
let mut this = Self::default();
|
||||
let error_pattern_regex =
|
||||
Regex::new(r"//(\[(?P<revision>[^\]]+)\])?~(?P<offset>\||[\^]+)?\s*(?P<level>ERROR|HELP|WARN|NOTE)?:?(?P<text>.*)")
|
||||
Regex::new(r"//(\[(?P<revision>[^\]]+)\])?~(?P<offset>\||[\^]+)? *(?P<level>ERROR|HELP|WARN|NOTE)?:?(?P<text>.*)")
|
||||
.unwrap();
|
||||
|
||||
// The line that a `|` will refer to
|
||||
|
@ -116,7 +116,7 @@ fn line(&self, file: &Path) -> Option<usize> {
|
||||
}
|
||||
|
||||
pub(crate) fn filter_annotations_from_rendered(rendered: &str) -> std::borrow::Cow<'_, str> {
|
||||
let annotations = Regex::new(r"\s*//(\[[^\]]\])?~.*").unwrap();
|
||||
let annotations = Regex::new(r" *//(\[[^\]]\])?~.*").unwrap();
|
||||
annotations.replace_all(rendered, "")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user