@@ -43,15 +43,14 @@ pub struct Demangle<'a> {
43
43
44
44
/// De-mangles a Rust symbol into a more readable version
45
45
///
46
- /// All rust symbols by default are mangled as they contain characters that
46
+ /// All Rust symbols by default are mangled as they contain characters that
47
47
/// cannot be represented in all object files. The mangling mechanism is similar
48
48
/// to C++'s, but Rust has a few specifics to handle items like lifetimes in
49
49
/// symbols.
50
50
///
51
- /// This function will take a **mangled** symbol (typically acquired from a
52
- /// `Symbol` which is in turn resolved from a `Frame`) and then writes the
53
- /// de-mangled version into the given `writer`. If the symbol does not look like
54
- /// a mangled symbol, it is still written to `writer`.
51
+ /// This function will take a **mangled** symbol and return a value. When printed,
52
+ /// the de-mangled version will be written. If the symbol does not look like
53
+ /// a mangled symbol, the original value will be written instead.
55
54
///
56
55
/// # Examples
57
56
///
@@ -63,7 +62,7 @@ pub struct Demangle<'a> {
63
62
/// assert_eq!(demangle("foo").to_string(), "foo");
64
63
/// ```
65
64
66
- // All rust symbols are in theory lists of "::"-separated identifiers. Some
65
+ // All Rust symbols are in theory lists of "::"-separated identifiers. Some
67
66
// assemblers, however, can't handle these characters in symbol names. To get
68
67
// around this, we use C++-style mangling. The mangling method is:
69
68
//
@@ -82,7 +81,7 @@ pub struct Demangle<'a> {
82
81
// etc. Additionally, this doesn't handle glue symbols at all.
83
82
pub fn demangle ( mut s : & str ) -> Demangle {
84
83
// During ThinLTO LLVM may import and rename internal symbols, so strip out
85
- // those endings first as they're on of the last manglings applied to symbol
84
+ // those endings first as they're one of the last manglings applied to symbol
86
85
// names.
87
86
let llvm = ".llvm." ;
88
87
if let Some ( i) = s. find ( llvm) {
@@ -100,7 +99,7 @@ pub fn demangle(mut s: &str) -> Demangle {
100
99
}
101
100
102
101
// First validate the symbol. If it doesn't look like anything we're
103
- // expecting, we just print it literally. Note that we must handle non-rust
102
+ // expecting, we just print it literally. Note that we must handle non-Rust
104
103
// symbols because we could have any function in the backtrace.
105
104
let mut valid = true ;
106
105
let mut inner = s;
0 commit comments