Skip to content
Permalink
Browse files

plugin_registrary: use normal deprecation instead of hard coded warning.

  • Loading branch information...
Centril committed Oct 3, 2019
1 parent 287ceed commit 1b8ec975fc15434b58d5d3db8304170c9c6ebf1a
@@ -278,13 +278,21 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
),

// Plugins:
ungated!(plugin_registrar, Normal, template!(Word)),
(
sym::plugin_registrar, Normal, template!(Word),
Gated(
Stability::Deprecated("https://github.com/rust-lang/rust/issues/29597", None),
sym::plugin_registrar,
"compiler plugins are deprecated",
cfg_fn!(plugin_registrar)
)
),
(
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",
"compiler plugins are deprecated",
cfg_fn!(plugin)
)
),
@@ -311,10 +311,6 @@ 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,
@@ -1,8 +1,7 @@
// ignore-tidy-linelength
// aux-build:attr-plugin-test.rs

#![plugin(attr_plugin_test)]
//~^ 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
//~^ ERROR compiler plugins are deprecated
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated

fn main() {}
@@ -1,14 +1,14 @@
error[E0658]: compiler plugins are deprecated and will be removed in 1.44.0
--> $DIR/gated-plugin.rs:4:1
error[E0658]: compiler plugins are deprecated
--> $DIR/gated-plugin.rs:3:1
|
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
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/gated-plugin.rs:3:1
|
LL | #![plugin(attr_plugin_test)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
@@ -5,6 +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
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated

fn main() {}
@@ -4,7 +4,7 @@ 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
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/macro-crate-rlib.rs:6:1
|
LL | #![plugin(rlib_crate_test)]
@@ -32,9 +32,13 @@

// check-pass

#![feature(test)]
#![feature(test, plugin_registrar)]
#![warn(unused_attributes, unknown_lints)]

// Exception, a gated and deprecated attribute.

#![plugin_registrar] //~ WARN unused attribute

// UNGATED WHITE-LISTED BUILT-IN ATTRIBUTES

#![warn(x5400)] //~ WARN unknown lint: `x5400`
@@ -43,7 +47,6 @@
#![deny(x5100)] //~ WARN unknown lint: `x5100`
#![macro_use] // (allowed if no argument; see issue-43160-gating-of-macro_use.rs)
#![macro_export] //~ WARN unused attribute
#![plugin_registrar] //~ WARN unused attribute
// skipping testing of cfg
// skipping testing of cfg_attr
#![main] //~ WARN unused attribute

0 comments on commit 1b8ec97

Please sign in to comment.
You can’t perform that action at this time.