Skip to content

Commit 1b8ec97

Browse files
committed
plugin_registrary: use normal deprecation instead of hard coded warning.
1 parent 287ceed commit 1b8ec97

21 files changed

+313
-265
lines changed

src/libsyntax/feature_gate/builtin_attrs.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,21 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
278278
),
279279

280280
// Plugins:
281-
ungated!(plugin_registrar, Normal, template!(Word)),
281+
(
282+
sym::plugin_registrar, Normal, template!(Word),
283+
Gated(
284+
Stability::Deprecated("https://github.com/rust-lang/rust/issues/29597", None),
285+
sym::plugin_registrar,
286+
"compiler plugins are deprecated",
287+
cfg_fn!(plugin_registrar)
288+
)
289+
),
282290
(
283291
sym::plugin, CrateLevel, template!(List: "name|name(args)"),
284292
Gated(
285293
Stability::Deprecated("https://github.com/rust-lang/rust/issues/29597", None),
286294
sym::plugin,
287-
"compiler plugins are deprecated and will be removed in 1.44.0",
295+
"compiler plugins are deprecated",
288296
cfg_fn!(plugin)
289297
)
290298
),

src/libsyntax/feature_gate/check.rs

-4
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
311311
if attr::contains_name(&i.attrs[..], sym::plugin_registrar) {
312312
gate_feature_post!(&self, plugin_registrar, i.span,
313313
"compiler plugins are experimental and possibly buggy");
314-
self.parse_sess.span_diagnostic.span_warn(
315-
i.span,
316-
"`#[plugin_registrar]` is deprecated and will be removed in 1.44.0",
317-
);
318314
}
319315
if attr::contains_name(&i.attrs[..], sym::start) {
320316
gate_feature_post!(&self, start, i.span,

src/test/ui-fulldeps/gated-plugin.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
// ignore-tidy-linelength
21
// aux-build:attr-plugin-test.rs
32

43
#![plugin(attr_plugin_test)]
5-
//~^ ERROR compiler plugins are deprecated and will be removed in 1.44.0
6-
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated and will be removed in 1.44.0
4+
//~^ ERROR compiler plugins are deprecated
5+
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
76

87
fn main() {}

src/test/ui-fulldeps/gated-plugin.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
error[E0658]: compiler plugins are deprecated and will be removed in 1.44.0
2-
--> $DIR/gated-plugin.rs:4:1
1+
error[E0658]: compiler plugins are deprecated
2+
--> $DIR/gated-plugin.rs:3:1
33
|
44
LL | #![plugin(attr_plugin_test)]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: for more information, see https://github.com/rust-lang/rust/issues/29597
88
= help: add `#![feature(plugin)]` to the crate attributes to enable
99

10-
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
11-
--> $DIR/gated-plugin.rs:4:1
10+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
11+
--> $DIR/gated-plugin.rs:3:1
1212
|
1313
LL | #![plugin(attr_plugin_test)]
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute

src/test/ui-fulldeps/macro-crate-rlib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
#![feature(plugin)]
66
#![plugin(rlib_crate_test)]
77
//~^ ERROR: plugin `rlib_crate_test` only found in rlib format, but must be available in dylib format
8-
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated and will be removed in 1.44.0
8+
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
99

1010
fn main() {}

src/test/ui-fulldeps/macro-crate-rlib.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0457]: plugin `rlib_crate_test` only found in rlib format, but must be av
44
LL | #![plugin(rlib_crate_test)]
55
| ^^^^^^^^^^^^^^^
66

7-
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
7+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
88
--> $DIR/macro-crate-rlib.rs:6:1
99
|
1010
LL | #![plugin(rlib_crate_test)]

src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@
3232

3333
// check-pass
3434

35-
#![feature(test)]
35+
#![feature(test, plugin_registrar)]
3636
#![warn(unused_attributes, unknown_lints)]
3737

38+
// Exception, a gated and deprecated attribute.
39+
40+
#![plugin_registrar] //~ WARN unused attribute
41+
3842
// UNGATED WHITE-LISTED BUILT-IN ATTRIBUTES
3943

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

0 commit comments

Comments
 (0)