Skip to content

Commit ae41bcd

Browse files
authored
Rollup merge of rust-lang#64675 - Centril:deprecate-plugin, r=oli-obk
Deprecate `#![plugin]` & `#[plugin_registrar]` This PR deprecates `#![plugin]` and `#[plugin_registrar]`. ~A removal deadline is set: 1.44.0. This will be in 9 months from now and should give everyone who is still relying on the feature ample time to rid themselves of this dependency.~ cc rust-lang#29597 r? @Mark-Simulacrum
2 parents 2d5f4df + d1f95ef commit ae41bcd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+579
-244
lines changed

src/libsyntax/feature_gate/builtin_attrs.rs

+17-4
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,23 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
278278
),
279279

280280
// Plugins:
281-
ungated!(plugin_registrar, Normal, template!(Word)),
282-
gated!(
283-
plugin, CrateLevel, template!(List: "name|name(args)"),
284-
"compiler plugins are experimental and possibly buggy",
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+
),
290+
(
291+
sym::plugin, CrateLevel, template!(List: "name|name(args)"),
292+
Gated(
293+
Stability::Deprecated("https://github.com/rust-lang/rust/issues/29597", None),
294+
sym::plugin,
295+
"compiler plugins are deprecated",
296+
cfg_fn!(plugin)
297+
)
285298
),
286299

287300
// Testing:

src/test/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl MetadataLoader for NoLlvmMetadataLoader {
4141
struct TheBackend;
4242

4343
impl CodegenBackend for TheBackend {
44-
fn metadata_loader(&self) -> Box<MetadataLoader + Sync> {
44+
fn metadata_loader(&self) -> Box<dyn MetadataLoader + Sync> {
4545
Box::new(NoLlvmMetadataLoader)
4646
}
4747

@@ -64,15 +64,15 @@ impl CodegenBackend for TheBackend {
6464
tcx: TyCtxt<'tcx>,
6565
_metadata: EncodedMetadata,
6666
_need_metadata_module: bool,
67-
) -> Box<Any> {
67+
) -> Box<dyn Any> {
6868
use rustc::hir::def_id::LOCAL_CRATE;
6969

7070
Box::new(tcx.crate_name(LOCAL_CRATE) as Symbol)
7171
}
7272

7373
fn join_codegen_and_link(
7474
&self,
75-
ongoing_codegen: Box<Any>,
75+
ongoing_codegen: Box<dyn Any>,
7676
sess: &Session,
7777
_dep_graph: &DepGraph,
7878
outputs: &OutputFilenames,
@@ -97,6 +97,6 @@ impl CodegenBackend for TheBackend {
9797

9898
/// This is the entrypoint for a hot plugged rustc_codegen_llvm
9999
#[no_mangle]
100-
pub fn __rustc_codegen_backend() -> Box<CodegenBackend> {
100+
pub fn __rustc_codegen_backend() -> Box<dyn CodegenBackend> {
101101
Box::new(TheBackend)
102102
}

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// aux-build:attr-plugin-test.rs
22

33
#![plugin(attr_plugin_test)]
4-
//~^ ERROR compiler plugins are experimental and possibly buggy
4+
//~^ ERROR compiler plugins are deprecated
5+
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
56

67
fn main() {}
+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0658]: compiler plugins are experimental and possibly buggy
1+
error[E0658]: compiler plugins are deprecated
22
--> $DIR/gated-plugin.rs:3:1
33
|
44
LL | #![plugin(attr_plugin_test)]
@@ -7,6 +7,14 @@ 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
11+
--> $DIR/gated-plugin.rs:3:1
12+
|
13+
LL | #![plugin(attr_plugin_test)]
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
15+
|
16+
= note: `#[warn(deprecated)]` on by default
17+
1018
error: aborting due to previous error
1119

1220
For more information about this error, try `rustc --explain E0658`.

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

+1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44

55
#![feature(plugin)] //~ ERROR crate is not marked with #![crate_okay]
66
#![plugin(lint_for_crate)]
7+
//~^ WARN use of deprecated attribute `plugin`
78

89
pub fn main() { }

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

+9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
2+
--> $DIR/issue-15778-fail.rs:6:1
3+
|
4+
LL | #![plugin(lint_for_crate)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
6+
|
7+
= note: `#[warn(deprecated)]` on by default
8+
19
error: crate is not marked with #![crate_okay]
210
--> $DIR/issue-15778-fail.rs:5:1
311
|
412
LL | / #![feature(plugin)]
513
LL | | #![plugin(lint_for_crate)]
614
LL | |
15+
LL | |
716
LL | | pub fn main() { }
817
| |_________________^
918
|
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
2+
--> $DIR/issue-15778-pass.rs:8:1
3+
|
4+
LL | #![plugin(lint_for_crate_rpass)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
6+
|
7+
= note: `#[warn(deprecated)]` on by default
8+
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
2+
--> $DIR/issue-40001.rs:6:1
3+
|
4+
LL | #![plugin(issue_40001_plugin)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
6+
|
7+
= note: `#[warn(deprecated)]` on by default
8+

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

+2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// compile-flags: -D lint-me
44

55
#![feature(plugin)]
6+
67
#![plugin(lint_group_plugin_test)]
8+
//~^ WARN use of deprecated attribute `plugin`
79

810
fn lintme() { } //~ ERROR item is named 'lintme'
911

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

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
2+
--> $DIR/lint-group-plugin-deny-cmdline.rs:7:1
3+
|
4+
LL | #![plugin(lint_group_plugin_test)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
6+
|
7+
= note: `#[warn(deprecated)]` on by default
8+
19
error: item is named 'lintme'
2-
--> $DIR/lint-group-plugin-deny-cmdline.rs:8:1
10+
--> $DIR/lint-group-plugin-deny-cmdline.rs:10:1
311
|
412
LL | fn lintme() { }
513
| ^^^^^^^^^^^^^^^
614
|
715
= note: `-D test-lint` implied by `-D lint-me`
816

917
error: item is named 'pleaselintme'
10-
--> $DIR/lint-group-plugin-deny-cmdline.rs:10:1
18+
--> $DIR/lint-group-plugin-deny-cmdline.rs:12:1
1119
|
1220
LL | fn pleaselintme() { }
1321
| ^^^^^^^^^^^^^^^^^^^^^

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

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
2+
--> $DIR/lint-group-plugin.rs:6:1
3+
|
4+
LL | #![plugin(lint_group_plugin_test)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
6+
|
7+
= note: `#[warn(deprecated)]` on by default
8+
19
warning: item is named 'lintme'
210
--> $DIR/lint-group-plugin.rs:9:1
311
|

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

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
2+
--> $DIR/lint-plugin-cmdline-allow.rs:8:1
3+
|
4+
LL | #![plugin(lint_plugin_test)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
6+
|
7+
= note: `#[warn(deprecated)]` on by default
8+
19
warning: function is never used: `lintme`
210
--> $DIR/lint-plugin-cmdline-allow.rs:10:1
311
|

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

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#![feature(plugin)]
55
#![plugin(lint_plugin_test)]
6+
//~^ WARN use of deprecated attribute `plugin`
67
#![deny(test_lint)]
78

89
fn lintme() { } //~ ERROR item is named 'lintme'

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

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
2+
--> $DIR/lint-plugin-deny-attr.rs:5:1
3+
|
4+
LL | #![plugin(lint_plugin_test)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
6+
|
7+
= note: `#[warn(deprecated)]` on by default
8+
19
error: item is named 'lintme'
2-
--> $DIR/lint-plugin-deny-attr.rs:8:1
10+
--> $DIR/lint-plugin-deny-attr.rs:9:1
311
|
412
LL | fn lintme() { }
513
| ^^^^^^^^^^^^^^^
614
|
715
note: lint level defined here
8-
--> $DIR/lint-plugin-deny-attr.rs:6:9
16+
--> $DIR/lint-plugin-deny-attr.rs:7:9
917
|
1018
LL | #![deny(test_lint)]
1119
| ^^^^^^^^^

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

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#![feature(plugin)]
66
#![plugin(lint_plugin_test)]
7+
//~^ WARN use of deprecated attribute `plugin`
78

89
fn lintme() { } //~ ERROR item is named 'lintme'
910

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

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
2+
--> $DIR/lint-plugin-deny-cmdline.rs:6:1
3+
|
4+
LL | #![plugin(lint_plugin_test)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
6+
|
7+
= note: `#[warn(deprecated)]` on by default
8+
19
error: item is named 'lintme'
2-
--> $DIR/lint-plugin-deny-cmdline.rs:8:1
10+
--> $DIR/lint-plugin-deny-cmdline.rs:9:1
311
|
412
LL | fn lintme() { }
513
| ^^^^^^^^^^^^^^^

src/test/ui-fulldeps/lint-plugin-forbid-attrs.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#![feature(plugin)]
55
#![plugin(lint_plugin_test)]
6+
//~^ WARN use of deprecated attribute `plugin`
67
#![forbid(test_lint)]
78

89
fn lintme() { } //~ ERROR item is named 'lintme'

src/test/ui-fulldeps/lint-plugin-forbid-attrs.stderr

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
2-
--> $DIR/lint-plugin-forbid-attrs.rs:10:9
2+
--> $DIR/lint-plugin-forbid-attrs.rs:11:9
33
|
44
LL | #![forbid(test_lint)]
55
| --------- `forbid` level set here
66
...
77
LL | #[allow(test_lint)]
88
| ^^^^^^^^^ overruled by previous forbid
99

10+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
11+
--> $DIR/lint-plugin-forbid-attrs.rs:5:1
12+
|
13+
LL | #![plugin(lint_plugin_test)]
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
15+
|
16+
= note: `#[warn(deprecated)]` on by default
17+
1018
error: item is named 'lintme'
11-
--> $DIR/lint-plugin-forbid-attrs.rs:8:1
19+
--> $DIR/lint-plugin-forbid-attrs.rs:9:1
1220
|
1321
LL | fn lintme() { }
1422
| ^^^^^^^^^^^^^^^
1523
|
1624
note: lint level defined here
17-
--> $DIR/lint-plugin-forbid-attrs.rs:6:11
25+
--> $DIR/lint-plugin-forbid-attrs.rs:7:11
1826
|
1927
LL | #![forbid(test_lint)]
2028
| ^^^^^^^^^

src/test/ui-fulldeps/lint-plugin-forbid-cmdline.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#![feature(plugin)]
66
#![plugin(lint_plugin_test)]
7-
7+
//~^ WARN use of deprecated attribute `plugin`
88
fn lintme() { } //~ ERROR item is named 'lintme'
99

1010
#[allow(test_lint)] //~ ERROR allow(test_lint) overruled by outer forbid(test_lint)

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

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ LL | #[allow(test_lint)]
66
|
77
= note: `forbid` lint level was set on command line
88

9+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
10+
--> $DIR/lint-plugin-forbid-cmdline.rs:6:1
11+
|
12+
LL | #![plugin(lint_plugin_test)]
13+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
14+
|
15+
= note: `#[warn(deprecated)]` on by default
16+
917
error: item is named 'lintme'
1018
--> $DIR/lint-plugin-forbid-cmdline.rs:8:1
1119
|

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

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
2+
--> $DIR/lint-plugin.rs:5:1
3+
|
4+
LL | #![plugin(lint_plugin_test)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
6+
|
7+
= note: `#[warn(deprecated)]` on by default
8+
19
warning: item is named 'lintme'
210
--> $DIR/lint-plugin.rs:8:1
311
|

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

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ warning: lint name `test_lint` is deprecated and does not have an effect anymore
22
|
33
= note: requested on the command line with `-A test_lint`
44

5+
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
6+
--> $DIR/lint-tool-cmdline-allow.rs:8:1
7+
|
8+
LL | #![plugin(lint_tool_test)]
9+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
10+
|
11+
= note: `#[warn(deprecated)]` on by default
12+
513
warning: item is named 'lintme'
614
--> $DIR/lint-tool-cmdline-allow.rs:10:1
715
|

src/test/ui-fulldeps/lint-tool-test.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#![feature(plugin)]
66
#![plugin(lint_tool_test)]
7+
//~^ WARN use of deprecated attribute `plugin`
78
#![allow(dead_code)]
89
#![cfg_attr(foo, warn(test_lint))]
910
//~^ WARNING lint name `test_lint` is deprecated and may not have an effect in the future

0 commit comments

Comments
 (0)