> For the complete documentation index, see [llms.txt](https://docs.hex-rays.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hex-rays.com/add-ons/plugins/concepts/plugins-shipped-with-ida/rust-plugin.md).

# Rust plugin

The binaries produced by the Rust compiler have some peculiarities which make them difficult to analyze, such as:

* non-standard calling conventions
* non-terminated string literals
* unusual name mangling scheme

By default, Rust plugin is enabled if one of the following condition is true

* one address is named `rust_begin_unwind`
* the string `rustc-` can be found somewhere in the program
  * If the segment `.rodata` exists, the search is limited to this segment

## String literal analysis

Rust plugin walks to all addresses in segment with name ending in `__const`, `.rodata` or `.rdata` and creates string literals on xref

* on dref, the string literal is set up to the next dref
* on cref, Rust tries to retrieve length from nearby instructions
  * Arm, Risc-V and pc proc module benefit from this

To force the string literal detection:

```
  idaapi.load_and_run_plugin("rust", 1)
```

## Demangling name

Rust plugin also offers the possibility to configure a demangler library for rust. By default the plugin will use the `librustdemangle` library that is shipped with IDA. You can disable this feature in **Edit → Plugin → Rust language helper** or specify another library to use.

See `cfg/rust.cfg` for the possible options

## List of `-Orust` options

* `on`: enable rust plugin for this session of IDA
* `off`: disable rust plugin for this session of IDA

## Example

```
  -Orust:off
```

This disable the plugin for this session of IDA.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hex-rays.com/add-ons/plugins/concepts/plugins-shipped-with-ida/rust-plugin.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
