File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 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> {
169169 . unwrap_or ( line. len ( ) ) ;
170170
171171 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 ( ) ;
174181 } 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+ }
180186 }
181187}
182188
You can’t perform that action at this time.
0 commit comments