Skip to content

Commit aa80647

Browse files
committed
Deprecate rustc plugin support in cargo
It has been removed entirely from rustc itself already
1 parent f9946d1 commit aa80647

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/cargo/util/toml/targets.rs

+11
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,17 @@ fn clean_lib(
203203
}
204204
};
205205

206+
if lib.plugin == Some(true) {
207+
warnings.push(format!(
208+
"support for rustc plugins has been removed from rustc. \
209+
library `{}` should not specify `plugin = true`",
210+
name_or_panic(lib)
211+
));
212+
warnings.push(format!(
213+
"support for `plugin = true` will be removed from cargo in the future"
214+
));
215+
}
216+
206217
// Per the Macros 1.1 RFC:
207218
//
208219
// > Initially if a crate is compiled with the `proc-macro` crate type

tests/testsuite/proc_macro.rs

+5
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,11 @@ fn proc_macro_crate_type_warning_plugin() {
378378
.build();
379379

380380
foo.cargo("check")
381+
.with_stderr_contains(
382+
"[WARNING] support for rustc plugins has been removed from rustc. \
383+
library `foo` should not specify `plugin = true`")
384+
.with_stderr_contains(
385+
"[WARNING] support for `plugin = true` will be removed from cargo in the future")
381386
.with_stderr_contains(
382387
"[WARNING] proc-macro library `foo` should not specify `plugin = true`")
383388
.with_stderr_contains(

0 commit comments

Comments
 (0)