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 3131extern crate std;
3232
3333mod legacy;
34+ mod v0;
3435
3536use core:: fmt;
3637
@@ -43,6 +44,7 @@ pub struct Demangle<'a> {
4344
4445enum DemangleStyle < ' a > {
4546 Legacy ( legacy:: Demangle < ' a > ) ,
47+ V0 ( v0:: Demangle < ' a > ) ,
4648}
4749
4850/// De-mangles a Rust symbol into a more readable version
@@ -93,7 +95,10 @@ pub fn demangle(mut s: &str) -> Demangle {
9395
9496 let style = match legacy:: demangle ( s) {
9597 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+ } ,
97102 } ;
98103 Demangle {
99104 style : style,
@@ -174,6 +179,9 @@ impl<'a> fmt::Display for Demangle<'a> {
174179 Some ( DemangleStyle :: Legacy ( ref d) ) => {
175180 try!( fmt:: Display :: fmt ( d, f) )
176181 }
182+ Some ( DemangleStyle :: V0 ( ref d) ) => {
183+ try!( fmt:: Display :: fmt ( d, f) )
184+ }
177185 }
178186 f. write_str ( self . suffix )
179187 }
You can’t perform that action at this time.
0 commit comments