Skip to content

Commit da0afc1

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 f7ee31e + d1f95ef commit da0afc1

File tree

52 files changed

+579
-244
lines changed

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

Lines changed: 17 additions & 4 deletions
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 2 additions & 1 deletion
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() {}
Lines changed: 9 additions & 1 deletion
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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
|
Lines changed: 8 additions & 0 deletions
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+
Lines changed: 8 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 10 additions & 2 deletions
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
| ^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)