about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-09-22 01:32:51 +0200
committerMazdak Farrokhzad <twingoow@gmail.com>2019-10-03 06:46:52 +0200
commit287ceed469e11214ff2650f0aea94e94711aa401 (patch)
tree5af15396e3d8f509b503d8ebe8367e3af7f17549
parent2daa404e9a151a2e8262cbd6d8c209fd067aca16 (diff)
downloadrust-287ceed469e11214ff2650f0aea94e94711aa401.tar.gz
rust-287ceed469e11214ff2650f0aea94e94711aa401.zip
Deprecate `#![plugin]` and `#[plugin_registrar]`.
-rw-r--r--src/libsyntax/feature_gate/builtin_attrs.rs11
-rw-r--r--src/libsyntax/feature_gate/check.rs4
-rw-r--r--src/test/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs8
-rw-r--r--src/test/ui-fulldeps/gated-plugin.rs4
-rw-r--r--src/test/ui-fulldeps/gated-plugin.stderr12
-rw-r--r--src/test/ui-fulldeps/macro-crate-rlib.rs1
-rw-r--r--src/test/ui-fulldeps/macro-crate-rlib.stderr8
-rw-r--r--src/test/ui/feature-gates/feature-gate-plugin.rs3
-rw-r--r--src/test/ui/feature-gates/feature-gate-plugin.stderr10
-rw-r--r--src/test/ui/feature-gates/feature-gate-plugin_registrar.rs2
-rw-r--r--src/test/ui/feature-gates/feature-gate-plugin_registrar.stderr6
-rw-r--r--src/test/ui/invalid/invalid-plugin-attr.rs3
-rw-r--r--src/test/ui/invalid/invalid-plugin-attr.stderr14
-rw-r--r--src/test/ui/malformed/malformed-plugin-1.rs3
-rw-r--r--src/test/ui/malformed/malformed-plugin-1.stderr10
-rw-r--r--src/test/ui/malformed/malformed-plugin-2.rs3
-rw-r--r--src/test/ui/malformed/malformed-plugin-2.stderr10
-rw-r--r--src/test/ui/malformed/malformed-plugin-3.rs3
-rw-r--r--src/test/ui/malformed/malformed-plugin-3.stderr10
-rw-r--r--src/test/ui/multiple-plugin-registrars.stderr12
20 files changed, 119 insertions, 18 deletions
diff --git a/src/libsyntax/feature_gate/builtin_attrs.rs b/src/libsyntax/feature_gate/builtin_attrs.rs
index d14afc6deaa..d1c2ffb2880 100644
--- a/src/libsyntax/feature_gate/builtin_attrs.rs
+++ b/src/libsyntax/feature_gate/builtin_attrs.rs
@@ -279,9 +279,14 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
 
     // Plugins:
     ungated!(plugin_registrar, Normal, template!(Word)),
-    gated!(
-        plugin, CrateLevel, template!(List: "name|name(args)"),
-        "compiler plugins are experimental and possibly buggy",
+    (
+        sym::plugin, CrateLevel, template!(List: "name|name(args)"),
+        Gated(
+            Stability::Deprecated("https://github.com/rust-lang/rust/issues/29597", None),
+            sym::plugin,
+            "compiler plugins are deprecated and will be removed in 1.44.0",
+            cfg_fn!(plugin)
+        )
     ),
 
     // Testing:
diff --git a/src/libsyntax/feature_gate/check.rs b/src/libsyntax/feature_gate/check.rs
index d7fc74955bb..158f12839ae 100644
--- a/src/libsyntax/feature_gate/check.rs
+++ b/src/libsyntax/feature_gate/check.rs
@@ -311,6 +311,10 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
                 if attr::contains_name(&i.attrs[..], sym::plugin_registrar) {
                     gate_feature_post!(&self, plugin_registrar, i.span,
                                        "compiler plugins are experimental and possibly buggy");
+                    self.parse_sess.span_diagnostic.span_warn(
+                        i.span,
+                        "`#[plugin_registrar]` is deprecated and will be removed in 1.44.0",
+                    );
                 }
                 if attr::contains_name(&i.attrs[..], sym::start) {
                     gate_feature_post!(&self, start, i.span,
diff --git a/src/test/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs b/src/test/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs
index c1bcb8a1aa2..1566a153ec0 100644
--- a/src/test/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs
+++ b/src/test/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs
@@ -41,7 +41,7 @@ impl MetadataLoader for NoLlvmMetadataLoader {
 struct TheBackend;
 
 impl CodegenBackend for TheBackend {
-    fn metadata_loader(&self) -> Box<MetadataLoader + Sync> {
+    fn metadata_loader(&self) -> Box<dyn MetadataLoader + Sync> {
         Box::new(NoLlvmMetadataLoader)
     }
 
@@ -64,7 +64,7 @@ impl CodegenBackend for TheBackend {
         tcx: TyCtxt<'tcx>,
         _metadata: EncodedMetadata,
         _need_metadata_module: bool,
-    ) -> Box<Any> {
+    ) -> Box<dyn Any> {
         use rustc::hir::def_id::LOCAL_CRATE;
 
         Box::new(tcx.crate_name(LOCAL_CRATE) as Symbol)
@@ -72,7 +72,7 @@ impl CodegenBackend for TheBackend {
 
     fn join_codegen_and_link(
         &self,
-        ongoing_codegen: Box<Any>,
+        ongoing_codegen: Box<dyn Any>,
         sess: &Session,
         _dep_graph: &DepGraph,
         outputs: &OutputFilenames,
@@ -97,6 +97,6 @@ impl CodegenBackend for TheBackend {
 
 /// This is the entrypoint for a hot plugged rustc_codegen_llvm
 #[no_mangle]
-pub fn __rustc_codegen_backend() -> Box<CodegenBackend> {
+pub fn __rustc_codegen_backend() -> Box<dyn CodegenBackend> {
     Box::new(TheBackend)
 }
diff --git a/src/test/ui-fulldeps/gated-plugin.rs b/src/test/ui-fulldeps/gated-plugin.rs
index be1ec061480..2cae74e2411 100644
--- a/src/test/ui-fulldeps/gated-plugin.rs
+++ b/src/test/ui-fulldeps/gated-plugin.rs
@@ -1,6 +1,8 @@
+// ignore-tidy-linelength
 // aux-build:attr-plugin-test.rs
 
 #![plugin(attr_plugin_test)]
-//~^ ERROR compiler plugins are experimental and possibly buggy
+//~^ ERROR compiler plugins are deprecated and will be removed in 1.44.0
+//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated and will be removed in 1.44.0
 
 fn main() {}
diff --git a/src/test/ui-fulldeps/gated-plugin.stderr b/src/test/ui-fulldeps/gated-plugin.stderr
index c5c1326c4f3..0c0256bde0f 100644
--- a/src/test/ui-fulldeps/gated-plugin.stderr
+++ b/src/test/ui-fulldeps/gated-plugin.stderr
@@ -1,5 +1,5 @@
-error[E0658]: compiler plugins are experimental and possibly buggy
-  --> $DIR/gated-plugin.rs:3:1
+error[E0658]: compiler plugins are deprecated and will be removed in 1.44.0
+  --> $DIR/gated-plugin.rs:4:1
    |
 LL | #![plugin(attr_plugin_test)]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -7,6 +7,14 @@ LL | #![plugin(attr_plugin_test)]
    = note: for more information, see https://github.com/rust-lang/rust/issues/29597
    = help: add `#![feature(plugin)]` to the crate attributes to enable
 
+warning: use of deprecated attribute `plugin`: compiler plugins are deprecated and will be removed in 1.44.0. See https://github.com/rust-lang/rust/issues/29597
+  --> $DIR/gated-plugin.rs:4:1
+   |
+LL | #![plugin(attr_plugin_test)]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
+   |
+   = note: `#[warn(deprecated)]` on by default
+
 error: aborting due to previous error
 
 For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui-fulldeps/macro-crate-rlib.rs b/src/test/ui-fulldeps/macro-crate-rlib.rs
index 2962bb51fc4..27145396473 100644
--- a/src/test/ui-fulldeps/macro-crate-rlib.rs
+++ b/src/test/ui-fulldeps/macro-crate-rlib.rs
@@ -5,5 +5,6 @@
 #![feature(plugin)]
 #![plugin(rlib_crate_test)]
 //~^ ERROR: plugin `rlib_crate_test` only found in rlib format, but must be available in dylib format
+//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated and will be removed in 1.44.0
 
 fn main() {}
diff --git a/src/test/ui-fulldeps/macro-crate-rlib.stderr b/src/test/ui-fulldeps/macro-crate-rlib.stderr
index a5a5456a316..c625d8f61c2 100644
--- a/src/test/ui-fulldeps/macro-crate-rlib.stderr
+++ b/src/test/ui-fulldeps/macro-crate-rlib.stderr
@@ -4,5 +4,13 @@ error[E0457]: plugin `rlib_crate_test` only found in rlib format, but must be av
 LL | #![plugin(rlib_crate_test)]
    |           ^^^^^^^^^^^^^^^
 
+warning: use of deprecated attribute `plugin`: compiler plugins are deprecated and will be removed in 1.44.0. See https://github.com/rust-lang/rust/issues/29597
+  --> $DIR/macro-crate-rlib.rs:6:1
+   |
+LL | #![plugin(rlib_crate_test)]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
+   |
+   = note: `#[warn(deprecated)]` on by default
+
 error: aborting due to previous error
 
diff --git a/src/test/ui/feature-gates/feature-gate-plugin.rs b/src/test/ui/feature-gates/feature-gate-plugin.rs
index 977a5556899..4afa9d4082c 100644
--- a/src/test/ui/feature-gates/feature-gate-plugin.rs
+++ b/src/test/ui/feature-gates/feature-gate-plugin.rs
@@ -1,6 +1,7 @@
 // Test that `#![plugin(...)]` attribute is gated by `plugin` feature gate
 
 #![plugin(foo)]
-//~^ ERROR compiler plugins are experimental and possibly buggy
+//~^ ERROR compiler plugins are deprecated and will be removed in 1.44.0
+//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
 
 fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-plugin.stderr b/src/test/ui/feature-gates/feature-gate-plugin.stderr
index 0da9653c9af..db4919f3e09 100644
--- a/src/test/ui/feature-gates/feature-gate-plugin.stderr
+++ b/src/test/ui/feature-gates/feature-gate-plugin.stderr
@@ -1,4 +1,4 @@
-error[E0658]: compiler plugins are experimental and possibly buggy
+error[E0658]: compiler plugins are deprecated and will be removed in 1.44.0
   --> $DIR/feature-gate-plugin.rs:3:1
    |
 LL | #![plugin(foo)]
@@ -7,6 +7,14 @@ LL | #![plugin(foo)]
    = note: for more information, see https://github.com/rust-lang/rust/issues/29597
    = help: add `#![feature(plugin)]` to the crate attributes to enable
 
+warning: use of deprecated attribute `plugin`: compiler plugins are deprecated and will be removed in 1.44.0. See https://github.com/rust-lang/rust/issues/29597
+  --> $DIR/feature-gate-plugin.rs:3:1
+   |
+LL | #![plugin(foo)]
+   | ^^^^^^^^^^^^^^^ help: remove this attribute
+   |
+   = note: `#[warn(deprecated)]` on by default
+
 error: aborting due to previous error
 
 For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/feature-gate-plugin_registrar.rs b/src/test/ui/feature-gates/feature-gate-plugin_registrar.rs
index 0e357f89d14..6ff67de86fe 100644
--- a/src/test/ui/feature-gates/feature-gate-plugin_registrar.rs
+++ b/src/test/ui/feature-gates/feature-gate-plugin_registrar.rs
@@ -5,4 +5,6 @@
 #[plugin_registrar]
 pub fn registrar() {}
 //~^ ERROR compiler plugins are experimental
+//~| WARN `#[plugin_registrar]` is deprecated and will be removed in 1.44.0
+
 fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-plugin_registrar.stderr b/src/test/ui/feature-gates/feature-gate-plugin_registrar.stderr
index 93473bfd27b..1cf30b7a58e 100644
--- a/src/test/ui/feature-gates/feature-gate-plugin_registrar.stderr
+++ b/src/test/ui/feature-gates/feature-gate-plugin_registrar.stderr
@@ -7,6 +7,12 @@ LL | pub fn registrar() {}
    = note: for more information, see https://github.com/rust-lang/rust/issues/29597
    = help: add `#![feature(plugin_registrar)]` to the crate attributes to enable
 
+warning: `#[plugin_registrar]` is deprecated and will be removed in 1.44.0
+  --> $DIR/feature-gate-plugin_registrar.rs:6:1
+   |
+LL | pub fn registrar() {}
+   | ^^^^^^^^^^^^^^^^^^^^^
+
 error: aborting due to previous error
 
 For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/invalid/invalid-plugin-attr.rs b/src/test/ui/invalid/invalid-plugin-attr.rs
index 2cbd5233861..99f328137d4 100644
--- a/src/test/ui/invalid/invalid-plugin-attr.rs
+++ b/src/test/ui/invalid/invalid-plugin-attr.rs
@@ -1,7 +1,10 @@
+// ignore-tidy-linelength
+
 #![deny(unused_attributes)]
 #![feature(plugin)]
 
 #[plugin(bla)]  //~ ERROR unused attribute
                 //~^ ERROR should be an inner attribute
+//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated and will be removed in 1.44.0
 
 fn main() {}
diff --git a/src/test/ui/invalid/invalid-plugin-attr.stderr b/src/test/ui/invalid/invalid-plugin-attr.stderr
index 36714c39b31..06ac14dd467 100644
--- a/src/test/ui/invalid/invalid-plugin-attr.stderr
+++ b/src/test/ui/invalid/invalid-plugin-attr.stderr
@@ -1,17 +1,25 @@
+warning: use of deprecated attribute `plugin`: compiler plugins are deprecated and will be removed in 1.44.0. See https://github.com/rust-lang/rust/issues/29597
+  --> $DIR/invalid-plugin-attr.rs:6:1
+   |
+LL | #[plugin(bla)]
+   | ^^^^^^^^^^^^^^ help: remove this attribute
+   |
+   = note: `#[warn(deprecated)]` on by default
+
 error: unused attribute
-  --> $DIR/invalid-plugin-attr.rs:4:1
+  --> $DIR/invalid-plugin-attr.rs:6:1
    |
 LL | #[plugin(bla)]
    | ^^^^^^^^^^^^^^
    |
 note: lint level defined here
-  --> $DIR/invalid-plugin-attr.rs:1:9
+  --> $DIR/invalid-plugin-attr.rs:3:9
    |
 LL | #![deny(unused_attributes)]
    |         ^^^^^^^^^^^^^^^^^
 
 error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/invalid-plugin-attr.rs:4:1
+  --> $DIR/invalid-plugin-attr.rs:6:1
    |
 LL | #[plugin(bla)]
    | ^^^^^^^^^^^^^^
diff --git a/src/test/ui/malformed/malformed-plugin-1.rs b/src/test/ui/malformed/malformed-plugin-1.rs
index 28f6c8e7a6f..b8b76753de8 100644
--- a/src/test/ui/malformed/malformed-plugin-1.rs
+++ b/src/test/ui/malformed/malformed-plugin-1.rs
@@ -1,4 +1,7 @@
+// ignore-tidy-linelength
+
 #![feature(plugin)]
 #![plugin] //~ ERROR malformed `plugin` attribute
+//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated and will be removed in 1.44.0
 
 fn main() {}
diff --git a/src/test/ui/malformed/malformed-plugin-1.stderr b/src/test/ui/malformed/malformed-plugin-1.stderr
index a863cd48596..14675350255 100644
--- a/src/test/ui/malformed/malformed-plugin-1.stderr
+++ b/src/test/ui/malformed/malformed-plugin-1.stderr
@@ -1,8 +1,16 @@
 error: malformed `plugin` attribute input
-  --> $DIR/malformed-plugin-1.rs:2:1
+  --> $DIR/malformed-plugin-1.rs:4:1
    |
 LL | #![plugin]
    | ^^^^^^^^^^ help: must be of the form: `#[plugin(name|name(args))]`
 
+warning: use of deprecated attribute `plugin`: compiler plugins are deprecated and will be removed in 1.44.0. See https://github.com/rust-lang/rust/issues/29597
+  --> $DIR/malformed-plugin-1.rs:4:1
+   |
+LL | #![plugin]
+   | ^^^^^^^^^^ help: remove this attribute
+   |
+   = note: `#[warn(deprecated)]` on by default
+
 error: aborting due to previous error
 
diff --git a/src/test/ui/malformed/malformed-plugin-2.rs b/src/test/ui/malformed/malformed-plugin-2.rs
index 8ec7a71da29..0eabf5203e1 100644
--- a/src/test/ui/malformed/malformed-plugin-2.rs
+++ b/src/test/ui/malformed/malformed-plugin-2.rs
@@ -1,4 +1,7 @@
+// ignore-tidy-linelength
+
 #![feature(plugin)]
 #![plugin="bleh"] //~ ERROR malformed `plugin` attribute
+//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated and will be removed in 1.44.0
 
 fn main() {}
diff --git a/src/test/ui/malformed/malformed-plugin-2.stderr b/src/test/ui/malformed/malformed-plugin-2.stderr
index 6eb0c50ca93..591b9473741 100644
--- a/src/test/ui/malformed/malformed-plugin-2.stderr
+++ b/src/test/ui/malformed/malformed-plugin-2.stderr
@@ -1,8 +1,16 @@
 error: malformed `plugin` attribute input
-  --> $DIR/malformed-plugin-2.rs:2:1
+  --> $DIR/malformed-plugin-2.rs:4:1
    |
 LL | #![plugin="bleh"]
    | ^^^^^^^^^^^^^^^^^ help: must be of the form: `#[plugin(name|name(args))]`
 
+warning: use of deprecated attribute `plugin`: compiler plugins are deprecated and will be removed in 1.44.0. See https://github.com/rust-lang/rust/issues/29597
+  --> $DIR/malformed-plugin-2.rs:4:1
+   |
+LL | #![plugin="bleh"]
+   | ^^^^^^^^^^^^^^^^^ help: remove this attribute
+   |
+   = note: `#[warn(deprecated)]` on by default
+
 error: aborting due to previous error
 
diff --git a/src/test/ui/malformed/malformed-plugin-3.rs b/src/test/ui/malformed/malformed-plugin-3.rs
index c4713616b62..fd3e72c09ba 100644
--- a/src/test/ui/malformed/malformed-plugin-3.rs
+++ b/src/test/ui/malformed/malformed-plugin-3.rs
@@ -1,4 +1,7 @@
+// ignore-tidy-linelength
+
 #![feature(plugin)]
 #![plugin(foo="bleh")] //~ ERROR malformed `plugin` attribute
+//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated and will be removed in 1.44.0
 
 fn main() {}
diff --git a/src/test/ui/malformed/malformed-plugin-3.stderr b/src/test/ui/malformed/malformed-plugin-3.stderr
index f93fa0f65e8..ae24f09ecf0 100644
--- a/src/test/ui/malformed/malformed-plugin-3.stderr
+++ b/src/test/ui/malformed/malformed-plugin-3.stderr
@@ -1,8 +1,16 @@
 error[E0498]: malformed `plugin` attribute
-  --> $DIR/malformed-plugin-3.rs:2:1
+  --> $DIR/malformed-plugin-3.rs:4:1
    |
 LL | #![plugin(foo="bleh")]
    | ^^^^^^^^^^^^^^^^^^^^^^ malformed attribute
 
+warning: use of deprecated attribute `plugin`: compiler plugins are deprecated and will be removed in 1.44.0. See https://github.com/rust-lang/rust/issues/29597
+  --> $DIR/malformed-plugin-3.rs:4:1
+   |
+LL | #![plugin(foo="bleh")]
+   | ^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
+   |
+   = note: `#[warn(deprecated)]` on by default
+
 error: aborting due to previous error
 
diff --git a/src/test/ui/multiple-plugin-registrars.stderr b/src/test/ui/multiple-plugin-registrars.stderr
index 0e8379841f9..0e022e3234c 100644
--- a/src/test/ui/multiple-plugin-registrars.stderr
+++ b/src/test/ui/multiple-plugin-registrars.stderr
@@ -1,3 +1,15 @@
+warning: `#[plugin_registrar]` is deprecated and will be removed in 1.44.0
+  --> $DIR/multiple-plugin-registrars.rs:7:1
+   |
+LL | pub fn one() {}
+   | ^^^^^^^^^^^^^^^
+
+warning: `#[plugin_registrar]` is deprecated and will be removed in 1.44.0
+  --> $DIR/multiple-plugin-registrars.rs:10:1
+   |
+LL | pub fn two() {}
+   | ^^^^^^^^^^^^^^^
+
 error: multiple plugin registration functions found
    |
 note: one is here