Skip to content

Commit 71b0049

Browse files
committed
Plugins deprecation: don’t suggest simply removing the attribute
Building Servo with a recent Nightly produces: ```rust warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See #29597 --> components/script/lib.rs:14:1 | 14 | #![plugin(script_plugins)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute | = note: `#[warn(deprecated)]` on by default ``` First, linking to #29597 is not ideal since there is pretty much no discussion there of the deprecation and what can be used instead. This PR changes the link to the deprecation PR which does have more discussion. Second, the “remove this attribute” suggestion is rather unhelpful. Just because a feature is deprecated doesn’t mean that simply removing its use without a replacement is acceptable. In the case of custom lint, there is no replacement available. Prefixing a message with “help:” when telling users that they’re screwed honestly feels disrespectful. This PR also changes the message to be more factual.
1 parent a16dca3 commit 71b0049

33 files changed

+84
-78
lines changed

src/libsyntax/feature_gate/builtin_attrs.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,10 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
286286
(
287287
sym::plugin_registrar, Normal, template!(Word),
288288
Gated(
289-
Stability::Deprecated("https://github.com/rust-lang/rust/issues/29597", None),
289+
Stability::Deprecated(
290+
"https://github.com/rust-lang/rust/pull/64675",
291+
Some("may be removed in a future compiler version"),
292+
),
290293
sym::plugin_registrar,
291294
"compiler plugins are deprecated",
292295
cfg_fn!(plugin_registrar)
@@ -295,7 +298,10 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
295298
(
296299
sym::plugin, CrateLevel, template!(List: "name|name(args)"),
297300
Gated(
298-
Stability::Deprecated("https://github.com/rust-lang/rust/issues/29597", None),
301+
Stability::Deprecated(
302+
"https://github.com/rust-lang/rust/pull/64675",
303+
Some("may be removed in a future compiler version"),
304+
),
299305
sym::plugin,
300306
"compiler plugins are deprecated",
301307
cfg_fn!(plugin)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ LL | #![plugin(attr_plugin_test)]
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. See https://github.com/rust-lang/rust/issues/29597
10+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
1111
--> $DIR/gated-plugin.rs:3:1
1212
|
1313
LL | #![plugin(attr_plugin_test)]
14-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
1515
|
1616
= note: `#[warn(deprecated)]` on by default
1717

src/test/ui-fulldeps/issue-15778-fail.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
1+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
22
--> $DIR/issue-15778-fail.rs:6:1
33
|
44
LL | #![plugin(lint_for_crate)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
66
|
77
= note: `#[warn(deprecated)]` on by default
88

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
1+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
22
--> $DIR/issue-15778-pass.rs:8:1
33
|
44
LL | #![plugin(lint_for_crate_rpass)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
66
|
77
= note: `#[warn(deprecated)]` on by default
88

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
1+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
22
--> $DIR/issue-40001.rs:6:1
33
|
44
LL | #![plugin(issue_40001_plugin)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
66
|
77
= note: `#[warn(deprecated)]` on by default
88

src/test/ui-fulldeps/lint-group-plugin-deny-cmdline.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
1+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
22
--> $DIR/lint-group-plugin-deny-cmdline.rs:7:1
33
|
44
LL | #![plugin(lint_group_plugin_test)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
66
|
77
= note: `#[warn(deprecated)]` on by default
88

src/test/ui-fulldeps/lint-group-plugin.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
1+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
22
--> $DIR/lint-group-plugin.rs:6:1
33
|
44
LL | #![plugin(lint_group_plugin_test)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
66
|
77
= note: `#[warn(deprecated)]` on by default
88

src/test/ui-fulldeps/lint-plugin-cmdline-allow.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
1+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
22
--> $DIR/lint-plugin-cmdline-allow.rs:8:1
33
|
44
LL | #![plugin(lint_plugin_test)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
66
|
77
= note: `#[warn(deprecated)]` on by default
88

src/test/ui-fulldeps/lint-plugin-deny-attr.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
1+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
22
--> $DIR/lint-plugin-deny-attr.rs:5:1
33
|
44
LL | #![plugin(lint_plugin_test)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
66
|
77
= note: `#[warn(deprecated)]` on by default
88

src/test/ui-fulldeps/lint-plugin-deny-cmdline.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
1+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
22
--> $DIR/lint-plugin-deny-cmdline.rs:6:1
33
|
44
LL | #![plugin(lint_plugin_test)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
66
|
77
= note: `#[warn(deprecated)]` on by default
88

0 commit comments

Comments
 (0)