File tree 1 file changed +13
-7
lines changed
1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -169,14 +169,20 @@ fn demangle_line(line: &str, include_hash: bool) -> std::borrow::Cow<str> {
169
169
. unwrap_or ( line. len ( ) ) ;
170
170
171
171
let mangled = & line[ head..match_end] ;
172
- let demangled = if include_hash {
173
- format ! ( "{}" , demangle( mangled) )
172
+ if let Ok ( demangled) = try_demangle ( mangled) {
173
+ let demangled = if include_hash {
174
+ format ! ( "{}" , demangled)
175
+ } else {
176
+ format ! ( "{:#}" , demangled)
177
+ } ;
178
+ line. to_mut ( ) . replace_range ( head..match_end, & demangled) ;
179
+ // Start again after the replacement.
180
+ head = head + demangled. len ( ) ;
174
181
} else {
175
- format ! ( "{:#}" , demangle( mangled) )
176
- } ;
177
- line. to_mut ( ) . replace_range ( head..match_end, & demangled) ;
178
- // Start again after the replacement.
179
- head = head + demangled. len ( ) ;
182
+ // Skip over the full symbol. We don't try to find a partial Rust symbol in the wider
183
+ // matched text today.
184
+ head = head + mangled. len ( ) ;
185
+ }
180
186
}
181
187
}
182
188
You can’t perform that action at this time.
0 commit comments