# Function rustc_demangle::demangle [−] [src]

    pub fn demangle(s: &str) -> Demangle

De-mangles a Rust symbol into a more readable version

All rust symbols by default are mangled as they contain characters that cannot be represented in all object files. The mangling mechanism is similar to C++'s, but Rust has a few specifics to handle items like lifetimes in symbols.

This function will take a mangled symbol (typically acquired from a `Symbol` which is in turn resolved from a `Frame`) and then writes the de-mangled version into the given `writer`. If the symbol does not look like a mangled symbol, it is still written to `writer`.

# 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");

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)