@@ -283,7 +283,7 @@ impl<'a> fmt::Display for Demangle<'a> {
283
283
}
284
284
} else if rest. starts_with ( '$' ) {
285
285
macro_rules! demangle {
286
- ( $( $pat: expr => $demangled: expr) , * ) => ( {
286
+ ( $( $pat: expr => $demangled: expr, ) * ) => ( {
287
287
$( if rest. starts_with( $pat) {
288
288
try!( f. write_str( $demangled) ) ;
289
289
rest = & rest[ $pat. len( ) ..] ;
@@ -319,7 +319,8 @@ impl<'a> fmt::Display for Demangle<'a> {
319
319
"$u7d$" => "}" ,
320
320
"$u3b$" => ";" ,
321
321
"$u2b$" => "+" ,
322
- "$u22$" => "\" "
322
+ "$u21$" => "!" ,
323
+ "$u22$" => "\" " ,
323
324
}
324
325
} else {
325
326
let idx = match rest. char_indices ( ) . find ( |& ( _, c) | c == '$' || c == '.' ) {
@@ -364,7 +365,14 @@ mod tests {
364
365
365
366
fn ok ( sym : & str , expected : & str ) -> bool {
366
367
match super :: try_demangle ( sym) {
367
- Ok ( s) => s. to_string ( ) == expected,
368
+ Ok ( s) => {
369
+ if s. to_string ( ) == expected {
370
+ true
371
+ } else {
372
+ println ! ( "\n {}\n !=\n {}\n " , s, expected) ;
373
+ false
374
+ }
375
+ }
368
376
Err ( _) => {
369
377
println ! ( "error demangling" ) ;
370
378
false
@@ -498,4 +506,12 @@ mod tests {
498
506
fn handle_assoc_types ( ) {
499
507
t ! ( "_ZN151_$LT$alloc..boxed..Box$LT$alloc..boxed..FnBox$LT$A$C$$u20$Output$u3d$R$GT$$u20$$u2b$$u20$$u27$a$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$9call_once17h69e8f44b3723e1caE" , "<alloc::boxed::Box<alloc::boxed::FnBox<A, Output=R> + 'a> as core::ops::function::FnOnce<A>>::call_once::h69e8f44b3723e1ca" ) ;
500
508
}
509
+
510
+ #[ test]
511
+ fn handle_bang ( ) {
512
+ t ! (
513
+ "_ZN88_$LT$core..result..Result$LT$$u21$$C$$u20$E$GT$$u20$as$u20$std..process..Termination$GT$6report17hfc41d0da4a40b3e8E" ,
514
+ "<core::result::Result<!, E> as std::process::Termination>::report::hfc41d0da4a40b3e8"
515
+ ) ;
516
+ }
501
517
}
0 commit comments