-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-pluginsArea: compiler plugins, doc.rust-lang.org/nightly/unstable-book/language-features/plugin.htmlArea: compiler plugins, doc.rust-lang.org/nightly/unstable-book/language-features/plugin.html
Description
// plugin.rs
#![feature(plugin_registrar)]
extern crate rustc;
use rustc::plugin::Registry;
#[plugin_registrar]
pub fn plugin_registrar(_: &mut Registry) {
println!("registering!");
}
// plugin_user.rs
#![feature(phase)]
#[phase(plugin)] extern crate plugin;
fn main() {}
$ # only .so
$ rustc --crate-type dylib plugin.rs && rustc plugin_user.rs -L .
registering!
$ # both .so and .rlib
$ rustc --crate-type rlib plugin.rs && rustc plugin_user.rs -L .
registering!
$ # only .rlib
$ rm libplugin*.so
$ rustc plugin_user.rs -L .
(i.e. no output for the last one: the plugin isn't loaded.)
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-pluginsArea: compiler plugins, doc.rust-lang.org/nightly/unstable-book/language-features/plugin.htmlArea: compiler plugins, doc.rust-lang.org/nightly/unstable-book/language-features/plugin.html