16 releases

0.1.15 May 29, 2019
0.1.13 Jan 2, 2019
0.1.11 Dec 15, 2018
0.1.9 Jul 18, 2018
0.1.1 Jul 10, 2016
Download history 74930/week @ 2019-02-13 76445/week @ 2019-02-20 84252/week @ 2019-02-27 81829/week @ 2019-03-06 82923/week @ 2019-03-13 76282/week @ 2019-03-20 76423/week @ 2019-03-27 85108/week @ 2019-04-03 99187/week @ 2019-04-10 88664/week @ 2019-04-17 93071/week @ 2019-04-24 86563/week @ 2019-05-01 88677/week @ 2019-05-08 91653/week @ 2019-05-15 96756/week @ 2019-05-22

384,322 downloads per month
Used in 2,331 crates (25 directly)

MIT/Apache

60KB
1.5K SLoC

rustc-demangle

Symbol demangling for Rust

Build Status

Documentation

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in rustc-demangle you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

Demangle Rust compiler symbol names.

This crate provides a demangle function which will return a Demangle sentinel value that can be used to learn about the demangled version of a symbol name. The demangled representation will be the same as the original if it doesn't look like a mangled symbol name.

Demangle can be formatted with the Display trait. The alternate modifier (#) can be used to format the symbol name without the trailing hash value.

Examples

use rustc_demangle::demangle;

assert_eq!(demangle("_ZN4testE").to_string(), "test");
assert_eq!(demangle("_ZN3foo3barE").to_string(), "foo::bar");
assert_eq!(demangle("foo").to_string(), "foo");
// With hash
assert_eq!(format!("{}", demangle("_ZN3foo17h05af221e174051e9E")), "foo::h05af221e174051e9");
// Without hash
assert_eq!(format!("{:#}", demangle("_ZN3foo17h05af221e174051e9E")), "foo");

Dependencies

~135KB