about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKeegan McAllister <kmcallister@mozilla.com>2015-02-09 14:25:47 -0800
committerKeegan McAllister <kmcallister@mozilla.com>2015-02-09 14:25:47 -0800
commit1aedc45f85fe9feb70971f9d0c743c4af550a080 (patch)
tree71f5829b2649d91d29dbb7010d62bf26f157156b
parent93b642d9743edea728ef08b2d6fd17229caaad43 (diff)
Add a help message for deprecated #[plugin] extern crate
-rw-r--r--src/librustc/plugin/load.rs3
-rw-r--r--src/test/compile-fail/plugin-extern-crate-attr-deprecated.rs1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc/plugin/load.rs b/src/librustc/plugin/load.rs
index 08f5486fd38..a2ce474eda8 100644
--- a/src/librustc/plugin/load.rs
+++ b/src/librustc/plugin/load.rs
@@ -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();
diff --git a/src/test/compile-fail/plugin-extern-crate-attr-deprecated.rs b/src/test/compile-fail/plugin-extern-crate-attr-deprecated.rs
index e27f193cbe8..ccda5cbdceb 100644
--- a/src/test/compile-fail/plugin-extern-crate-attr-deprecated.rs
+++ b/src/test/compile-fail/plugin-extern-crate-attr-deprecated.rs
@@ -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() {}