diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2014-11-25 21:17:11 -0500 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-11-26 16:50:14 -0800 |
| commit | cd5c8235c5448a7234548c772468c8d2e8f150d9 (patch) | |
| tree | 0eee3d02c3bae381cf2a18296241ddd9ad04fac6 /src/librustc/plugin | |
| parent | fac5a07679cac21a580badc84b755b8df0f975cf (diff) | |
| download | rust-cd5c8235c5448a7234548c772468c8d2e8f150d9.tar.gz rust-cd5c8235c5448a7234548c772468c8d2e8f150d9.zip | |
/*! -> //!
Sister pull request of https://github.com/rust-lang/rust/pull/19288, but for the other style of block doc comment.
Diffstat (limited to 'src/librustc/plugin')
| -rw-r--r-- | src/librustc/plugin/mod.rs | 94 |
1 files changed, 46 insertions, 48 deletions
diff --git a/src/librustc/plugin/mod.rs b/src/librustc/plugin/mod.rs index a03ee471be6..8dd60880cdd 100644 --- a/src/librustc/plugin/mod.rs +++ b/src/librustc/plugin/mod.rs @@ -8,54 +8,52 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -/*! - * Infrastructure for compiler plugins. - * - * Plugins are Rust libraries which extend the behavior of `rustc` - * in various ways. - * - * Plugin authors will use the `Registry` type re-exported by - * this module, along with its methods. The rest of the module - * is for use by `rustc` itself. - * - * To define a plugin, build a dylib crate with a - * `#[plugin_registrar]` function: - * - * ```rust,ignore - * #![crate_name = "myplugin"] - * #![crate_type = "dylib"] - * #![feature(plugin_registrar)] - * - * extern crate rustc; - * - * use rustc::plugin::Registry; - * - * #[plugin_registrar] - * pub fn plugin_registrar(reg: &mut Registry) { - * reg.register_macro("mymacro", expand_mymacro); - * } - * - * fn expand_mymacro(...) { // details elided - * ``` - * - * WARNING: We currently don't check that the registrar function - * has the appropriate type! - * - * To use a plugin while compiling another crate: - * - * ```rust - * #![feature(phase)] - * - * #[phase(plugin)] - * extern crate myplugin; - * ``` - * - * If you also need the plugin crate available at runtime, use - * `phase(plugin, link)`. - * - * See [the compiler plugin guide](../../guide-plugin.html) - * for more examples. - */ +//! Infrastructure for compiler plugins. +//! +//! Plugins are Rust libraries which extend the behavior of `rustc` +//! in various ways. +//! +//! Plugin authors will use the `Registry` type re-exported by +//! this module, along with its methods. The rest of the module +//! is for use by `rustc` itself. +//! +//! To define a plugin, build a dylib crate with a +//! `#[plugin_registrar]` function: +//! +//! ```rust,ignore +//! #![crate_name = "myplugin"] +//! #![crate_type = "dylib"] +//! #![feature(plugin_registrar)] +//! +//! extern crate rustc; +//! +//! use rustc::plugin::Registry; +//! +//! #[plugin_registrar] +//! pub fn plugin_registrar(reg: &mut Registry) { +//! reg.register_macro("mymacro", expand_mymacro); +//! } +//! +//! fn expand_mymacro(...) { // details elided +//! ``` +//! +//! WARNING: We currently don't check that the registrar function +//! has the appropriate type! +//! +//! To use a plugin while compiling another crate: +//! +//! ```rust +//! #![feature(phase)] +//! +//! #[phase(plugin)] +//! extern crate myplugin; +//! ``` +//! +//! If you also need the plugin crate available at runtime, use +//! `phase(plugin, link)`. +//! +//! See [the compiler plugin guide](../../guide-plugin.html) +//! for more examples. pub use self::registry::Registry; |
