|
1.
|
|
|
# Introduction
|
|
|
type: Plain text
|
|
|
|
(no translation yet)
|
|
|
|
Located in
src/doc/guide-ffi.md:4 src/doc/guide-lifetimes.md:4
src/doc/guide-macros.md:13 src/doc/guide-plugin.md:28
src/doc/guide-tasks.md:4 src/doc/guide-unsafe.md:4
|
|
2.
|
|
|
% The Rust Compiler Plugins Guide
|
|
|
type: Plain text
|
|
|
|
(no translation yet)
|
|
|
|
Located in
src/doc/guide-plugin.md:2
|
|
3.
|
|
|
<div class="unstable-feature">
|
|
|
type: Plain text
|
|
|
|
(no translation yet)
|
|
|
|
Located in
src/doc/guide-plugin.md:4
|
|
4.
|
|
|
<p> <b>Warning:</b> Plugins are an advanced, unstable feature! For many details, the only available documentation is the <a href="syntax/index.html"><code>libsyntax</code></a> and <a href="rustc/index.html"><code>librustc</code></a> API docs, or even the source code itself. These internal compiler APIs are also subject to change at any time. </p>
|
|
|
type: Plain text
|
|
|
|
(no translation yet)
|
|
|
|
Located in
src/doc/guide-plugin.md:13
|
|
5.
|
|
|
<p> For defining new syntax it is often much easier to use Rust's <a href="guide-macros.html">built-in macro system</a>. </p>
|
|
|
type: Plain text
|
|
|
|
(no translation yet)
|
|
|
|
Located in
src/doc/guide-plugin.md:18
|
|
6.
|
|
|
<p style="margin-bottom: 0"> The code in this document uses language features not covered in the Rust Guide. See the <a href="reference.html">Reference Manual</a> for more information. </p>
|
|
|
type: Plain text
|
|
|
|
(no translation yet)
|
|
|
|
Located in
src/doc/guide-plugin.md:24
|
|
7.
|
|
|
</div>
|
|
|
type: Plain text
|
|
|
|
(no translation yet)
|
|
|
|
Located in
src/doc/guide-plugin.md:26
|
|
8.
|
|
|
`rustc` can load compiler plugins, which are user-provided libraries that extend the compiler's behavior with new syntax extensions, lint checks, etc.
|
|
|
type: Plain text
|
|
|
|
(no translation yet)
|
|
|
|
Located in
src/doc/guide-plugin.md:31
|
|
9.
|
|
|
A plugin is a dynamic library crate with a designated "registrar" function that registers extensions with `rustc`. Other crates can use these extensions by loading the plugin crate with `#[phase(plugin)] extern crate`. See the [`rustc::plugin`](rustc/plugin/index.html) documentation for more about the mechanics of defining and loading a plugin.
|
|
|
type: Plain text
|
|
|
|
(no translation yet)
|
|
|
|
Located in
src/doc/guide-plugin.md:37
|
|
10.
|
|
|
# Syntax extensions
|
|
|
type: Plain text
|
|
|
|
(no translation yet)
|
|
|
|
Located in
src/doc/guide-plugin.md:39
|