Skip to content

Commit 05463c9

Browse files
committed
Fix regex for PathBuf
According to logic in rust-lang#120557 (comment) the capture groups may be unnecessary and could possibly go with something as simple as `std::path::PathBuf` as done in CodeLLDB: https://github.com/vadimcn/codelldb/blob/05502bf75e4e7878a99b0bf0a7a81bba2922cbe3/formatters/rust.py#L59C56-L59C74 However for consistency will follow the pattern for now and consider updating all of regexes in a future PR.
1 parent 68b8879 commit 05463c9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/etc/lldb_commands

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ type summary add -F lldb_lookup.summary_lookup -e -x -h "^(core::([a-z_]+::)+)R
1616
type summary add -F lldb_lookup.summary_lookup -e -x -h "^(core::([a-z_]+::)+)RefMut<.+>$" --category Rust
1717
type summary add -F lldb_lookup.summary_lookup -e -x -h "^(core::([a-z_]+::)+)RefCell<.+>$" --category Rust
1818
type summary add -F lldb_lookup.summary_lookup -e -x -h "^core::num::([a-z_]+::)*NonZero.+$" --category Rust
19-
type summary add -F lldb_lookup.summary_lookup -e -x -h "^std::path::PathBuf$" --category Rust
2019
type summary add -F lldb_lookup.summary_lookup -e -x -h "^&(mut )?std::path::Path$" --category Rust
20+
type summary add -F lldb_lookup.summary_lookup -e -x -h "^(std::([a-z_]+::)+)PathBuf$" --category Rust
2121
type category enable Rust

src/etc/rust_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ class RustType(object):
5353
STD_REF_MUT_REGEX = re.compile(r"^(core::(\w+::)+)RefMut<.+>$")
5454
STD_REF_CELL_REGEX = re.compile(r"^(core::(\w+::)+)RefCell<.+>$")
5555
STD_NONZERO_NUMBER_REGEX = re.compile(r"^core::num::([a-z_]+::)*NonZero.+$")
56-
STD_PATHBUF_REGEX = re.compile(r"^std::path::PathBuf$")
5756
STD_PATH_REGEX = re.compile(r"^&(mut )?std::path::Path$")
57+
STD_PATHBUF_REGEX = re.compile(r"^(std::([a-z_]+::)+)PathBuf$")
5858

5959
TUPLE_ITEM_REGEX = re.compile(r"__\d+$")
6060

src/tools/compiletest/src/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,8 +1494,8 @@ impl<'test> TestCx<'test> {
14941494
"^(core::([a-z_]+::)+)RefMut<.+>$",
14951495
"^(core::([a-z_]+::)+)RefCell<.+>$",
14961496
"^core::num::([a-z_]+::)*NonZero.+$",
1497-
"^std::path::PathBuf$",
14981497
"^&(mut )?std::path::Path$",
1498+
"^(std::([a-z_]+::)+)PathBuf$",
14991499
];
15001500

15011501
// In newer versions of lldb, persistent results (the `$N =` part at the start of

0 commit comments

Comments
 (0)