File tree Expand file tree Collapse file tree 2 files changed +1049
-1
lines changed Expand file tree Collapse file tree 2 files changed +1049
-1
lines changed Original file line number Diff line number Diff line change 31
31
extern crate std;
32
32
33
33
mod legacy;
34
+ mod v0;
34
35
35
36
use core:: fmt;
36
37
@@ -43,6 +44,7 @@ pub struct Demangle<'a> {
43
44
44
45
enum DemangleStyle < ' a > {
45
46
Legacy ( legacy:: Demangle < ' a > ) ,
47
+ V0 ( v0:: Demangle < ' a > ) ,
46
48
}
47
49
48
50
/// De-mangles a Rust symbol into a more readable version
@@ -93,7 +95,10 @@ pub fn demangle(mut s: &str) -> Demangle {
93
95
94
96
let style = match legacy:: demangle ( s) {
95
97
Ok ( d) => Some ( DemangleStyle :: Legacy ( d) ) ,
96
- Err ( ( ) ) => None ,
98
+ Err ( ( ) ) => match v0:: demangle ( s) {
99
+ Ok ( d) => Some ( DemangleStyle :: V0 ( d) ) ,
100
+ Err ( v0:: Invalid ) => None ,
101
+ } ,
97
102
} ;
98
103
Demangle {
99
104
style : style,
@@ -174,6 +179,9 @@ impl<'a> fmt::Display for Demangle<'a> {
174
179
Some ( DemangleStyle :: Legacy ( ref d) ) => {
175
180
try!( fmt:: Display :: fmt ( d, f) )
176
181
}
182
+ Some ( DemangleStyle :: V0 ( ref d) ) => {
183
+ try!( fmt:: Display :: fmt ( d, f) )
184
+ }
177
185
}
178
186
f. write_str ( self . suffix )
179
187
}
You can’t perform that action at this time.
0 commit comments