Add a help message for deprecated #[plugin] extern crate

This commit is contained in:
Keegan McAllister 2015-02-09 14:25:47 -08:00
parent 93b642d974
commit 1aedc45f85
2 changed files with 4 additions and 0 deletions

View File

@ -139,6 +139,9 @@ impl<'a, 'v> Visitor<'v> for PluginLoader<'a> {
}
"plugin" => {
self.sess.span_err(attr.span, "#[plugin] on `extern crate` is deprecated");
self.sess.span_help(attr.span, &format!("use a crate attribute instead, \
i.e. #![plugin({})]",
item.ident.as_str())[]);
}
"macro_use" => {
let names = attr.meta_item_list();

View File

@ -9,6 +9,7 @@
// except according to those terms.
#[plugin] //~ ERROR #[plugin] on `extern crate` is deprecated
//~^ HELP use a crate attribute instead, i.e. #![plugin(std)]
extern crate std;
fn main() {}