@@ -188,17 +188,6 @@ fn to_lib_target(
188
188
let path = lib. path . as_ref ( ) . expect ( "previously resolved" ) ;
189
189
let path = package_root. join ( & path. 0 ) ;
190
190
191
- if lib. plugin == Some ( true ) {
192
- warnings. push ( format ! (
193
- "support for rustc plugins has been removed from rustc. \
194
- library `{}` should not specify `plugin = true`",
195
- name_or_panic( lib)
196
- ) ) ;
197
- warnings. push ( format ! (
198
- "support for `plugin = true` will be removed from cargo in the future"
199
- ) ) ;
200
- }
201
-
202
191
// Per the Macros 1.1 RFC:
203
192
//
204
193
// > Initially if a crate is compiled with the `proc-macro` crate type
@@ -208,8 +197,8 @@ fn to_lib_target(
208
197
//
209
198
// A plugin requires exporting plugin_registrar so a crate cannot be
210
199
// both at once.
211
- let crate_types = match ( lib. crate_types ( ) , lib. plugin , lib . proc_macro ( ) ) {
212
- ( Some ( kinds) , _, _ )
200
+ let crate_types = match ( lib. crate_types ( ) , lib. proc_macro ( ) ) {
201
+ ( Some ( kinds) , _)
213
202
if kinds. contains ( & CrateType :: Dylib . as_str ( ) . to_owned ( ) )
214
203
&& kinds. contains ( & CrateType :: Cdylib . as_str ( ) . to_owned ( ) ) =>
215
204
{
@@ -218,14 +207,7 @@ fn to_lib_target(
218
207
name_or_panic( lib)
219
208
) ) ;
220
209
}
221
- ( Some ( kinds) , _, _) if kinds. contains ( & "proc-macro" . to_string ( ) ) => {
222
- if let Some ( true ) = lib. plugin {
223
- // This is a warning to retain backwards compatibility.
224
- warnings. push ( format ! (
225
- "proc-macro library `{}` should not specify `plugin = true`" ,
226
- name_or_panic( lib)
227
- ) ) ;
228
- }
210
+ ( Some ( kinds) , _) if kinds. contains ( & "proc-macro" . to_string ( ) ) => {
229
211
warnings. push ( format ! (
230
212
"library `{}` should only specify `proc-macro = true` instead of setting `crate-type`" ,
231
213
name_or_panic( lib)
@@ -235,13 +217,9 @@ fn to_lib_target(
235
217
}
236
218
vec ! [ CrateType :: ProcMacro ]
237
219
}
238
- ( _, Some ( true ) , Some ( true ) ) => {
239
- anyhow:: bail!( "`lib.plugin` and `lib.proc-macro` cannot both be `true`" )
240
- }
241
- ( Some ( kinds) , _, _) => kinds. iter ( ) . map ( |s| s. into ( ) ) . collect ( ) ,
242
- ( None , Some ( true ) , _) => vec ! [ CrateType :: Dylib ] ,
243
- ( None , _, Some ( true ) ) => vec ! [ CrateType :: ProcMacro ] ,
244
- ( None , _, _) => vec ! [ CrateType :: Lib ] ,
220
+ ( Some ( kinds) , _) => kinds. iter ( ) . map ( |s| s. into ( ) ) . collect ( ) ,
221
+ ( None , Some ( true ) ) => vec ! [ CrateType :: ProcMacro ] ,
222
+ ( None , _) => vec ! [ CrateType :: Lib ] ,
245
223
} ;
246
224
247
225
let mut target = Target :: lib_target ( name_or_panic ( lib) , crate_types, path, edition) ;
@@ -869,11 +847,8 @@ fn configure(toml: &TomlTarget, target: &mut Target) -> CargoResult<()> {
869
847
Some ( false ) => RustdocScrapeExamples :: Disabled ,
870
848
Some ( true ) => RustdocScrapeExamples :: Enabled ,
871
849
} )
872
- . set_for_host ( match ( toml. plugin , toml. proc_macro ( ) ) {
873
- ( None , None ) => t2. for_host ( ) ,
874
- ( Some ( true ) , _) | ( _, Some ( true ) ) => true ,
875
- ( Some ( false ) , _) | ( _, Some ( false ) ) => false ,
876
- } ) ;
850
+ . set_for_host ( toml. proc_macro ( ) . unwrap_or_else ( || t2. for_host ( ) ) ) ;
851
+
877
852
if let Some ( edition) = toml. edition . clone ( ) {
878
853
target. set_edition (
879
854
edition
0 commit comments