Skip to content

Commit 1aedc45

Browse files
author
Keegan McAllister
committed
Add a help message for deprecated #[plugin] extern crate
1 parent 93b642d commit 1aedc45

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/librustc/plugin/load.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ impl<'a, 'v> Visitor<'v> for PluginLoader<'a> {
139139
}
140140
"plugin" => {
141141
self.sess.span_err(attr.span, "#[plugin] on `extern crate` is deprecated");
142+
self.sess.span_help(attr.span, &format!("use a crate attribute instead, \
143+
i.e. #![plugin({})]",
144+
item.ident.as_str())[]);
142145
}
143146
"macro_use" => {
144147
let names = attr.meta_item_list();

src/test/compile-fail/plugin-extern-crate-attr-deprecated.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
#[plugin] //~ ERROR #[plugin] on `extern crate` is deprecated
12+
//~^ HELP use a crate attribute instead, i.e. #![plugin(std)]
1213
extern crate std;
1314

1415
fn main() {}

0 commit comments

Comments
 (0)