diff --git a/src/cargo/util/toml/targets.rs b/src/cargo/util/toml/targets.rs index d004a76dc619..357a1f7661ad 100644 --- a/src/cargo/util/toml/targets.rs +++ b/src/cargo/util/toml/targets.rs @@ -203,6 +203,17 @@ fn clean_lib( } }; + if lib.plugin == Some(true) { + warnings.push(format!( + "support for rustc plugins has been removed from rustc. \ + library `{}` should not specify `plugin = true`", + name_or_panic(lib) + )); + warnings.push(format!( + "support for `plugin = true` will be removed from cargo in the future" + )); + } + // Per the Macros 1.1 RFC: // // > Initially if a crate is compiled with the `proc-macro` crate type diff --git a/tests/testsuite/proc_macro.rs b/tests/testsuite/proc_macro.rs index cabf251a0fa3..530d47164757 100644 --- a/tests/testsuite/proc_macro.rs +++ b/tests/testsuite/proc_macro.rs @@ -378,6 +378,11 @@ fn proc_macro_crate_type_warning_plugin() { .build(); foo.cargo("check") + .with_stderr_contains( + "[WARNING] support for rustc plugins has been removed from rustc. \ + library `foo` should not specify `plugin = true`") + .with_stderr_contains( + "[WARNING] support for `plugin = true` will be removed from cargo in the future") .with_stderr_contains( "[WARNING] proc-macro library `foo` should not specify `plugin = true`") .with_stderr_contains(