Skip to content

Commit 3dfed35

Browse files
committed
Auto merge of #124527 - jieyouxu:rollup-eslzncy, r=jieyouxu
Rollup of 7 pull requests Successful merges: - #124269 (Pretty-print parenthesis around binary in postfix match) - #124415 (Use probes more aggressively in new solver) - #124475 (Remove direct dependencies on lazy_static, once_cell and byteorder) - #124484 (Fix #124478 - offset_of! returns a temporary) - #124504 (Mark unions non-const-propagatable in `KnownPanicsLint` without calling layout) - #124508 (coverage: Avoid hard-coded values when visiting logical ops) - #124522 ([Refactor] Rename `Lint` and `LintGroup`'s `is_loaded` to `is_externally_loaded` ) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 4fbb60e + af99faf commit 3dfed35

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ colored = "2"
4646
ui_test = "0.21.1"
4747
rustc_version = "0.4"
4848
regex = "1.5.5"
49-
lazy_static = "1.4.0"
5049
tempfile = "3"
5150

5251
[package.metadata.rust-analyzer]

tests/ui.rs

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::ffi::OsString;
22
use std::num::NonZeroUsize;
33
use std::path::{Path, PathBuf};
4+
use std::sync::OnceLock;
45
use std::{env, process::Command};
56

67
use colored::*;
@@ -67,8 +68,8 @@ fn miri_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->
6768

6869
let mut config = Config {
6970
target: Some(target.to_owned()),
70-
stderr_filters: STDERR.clone(),
71-
stdout_filters: STDOUT.clone(),
71+
stderr_filters: stderr_filters().into(),
72+
stdout_filters: stdout_filters().into(),
7273
mode,
7374
program,
7475
out_dir: PathBuf::from(std::env::var_os("CARGO_TARGET_DIR").unwrap()).join("ui"),
@@ -174,15 +175,18 @@ fn run_tests(
174175
}
175176

176177
macro_rules! regexes {
177-
($name:ident: $($regex:expr => $replacement:expr,)*) => {lazy_static::lazy_static! {
178-
static ref $name: Vec<(Match, &'static [u8])> = vec![
179-
$((Regex::new($regex).unwrap().into(), $replacement.as_bytes()),)*
180-
];
181-
}};
178+
($name:ident: $($regex:expr => $replacement:expr,)*) => {
179+
fn $name() -> &'static [(Match, &'static [u8])] {
180+
static S: OnceLock<Vec<(Match, &'static [u8])>> = OnceLock::new();
181+
S.get_or_init(|| vec![
182+
$((Regex::new($regex).unwrap().into(), $replacement.as_bytes()),)*
183+
])
184+
}
185+
};
182186
}
183187

184188
regexes! {
185-
STDOUT:
189+
stdout_filters:
186190
// Windows file paths
187191
r"\\" => "/",
188192
// erase borrow tags
@@ -191,7 +195,7 @@ regexes! {
191195
}
192196

193197
regexes! {
194-
STDERR:
198+
stderr_filters:
195199
// erase line and column info
196200
r"\.rs:[0-9]+:[0-9]+(: [0-9]+:[0-9]+)?" => ".rs:LL:CC",
197201
// erase alloc ids

0 commit comments

Comments
 (0)