From 7482c54a5b4d53f13424ebaa9878c2623bc4b30d Mon Sep 17 00:00:00 2001 From: Erik Desjardins Date: Sun, 10 Mar 2024 12:08:20 -0400 Subject: [PATCH] impove symbol name normalization --- collector/src/artifact_stats.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collector/src/artifact_stats.rs b/collector/src/artifact_stats.rs index 697042897..6eea672f9 100644 --- a/collector/src/artifact_stats.rs +++ b/collector/src/artifact_stats.rs @@ -95,7 +95,7 @@ static RUSTC_HASH_REGEX: OnceLock = OnceLock::new(); /// Demangle the symbol and remove rustc mangling hashes. fn normalize_symbol_name(symbol: &str) -> String { - let regex = RUSTC_HASH_REGEX.get_or_init(|| Regex::new(r#"[a-z0-9]{15,16}"#).unwrap()); + let regex = RUSTC_HASH_REGEX.get_or_init(|| Regex::new(r#"(::)?\b[a-z0-9]{15,17}\b"#).unwrap()); let symbol = rustc_demangle::demangle(symbol).to_string(); regex.replace_all(&symbol, "").to_string()