@@ -188,17 +188,6 @@ fn to_lib_target(
188188 let path = lib. path . as_ref ( ) . expect ( "previously resolved" ) ;
189189 let path = package_root. join ( & path. 0 ) ;
190190
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-
202191 // Per the Macros 1.1 RFC:
203192 //
204193 // > Initially if a crate is compiled with the `proc-macro` crate type
@@ -208,8 +197,8 @@ fn to_lib_target(
208197 //
209198 // A plugin requires exporting plugin_registrar so a crate cannot be
210199 // 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) , _)
213202 if kinds. contains ( & CrateType :: Dylib . as_str ( ) . to_owned ( ) )
214203 && kinds. contains ( & CrateType :: Cdylib . as_str ( ) . to_owned ( ) ) =>
215204 {
@@ -218,14 +207,7 @@ fn to_lib_target(
218207 name_or_panic( lib)
219208 ) ) ;
220209 }
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 ( ) ) => {
229211 warnings. push ( format ! (
230212 "library `{}` should only specify `proc-macro = true` instead of setting `crate-type`" ,
231213 name_or_panic( lib)
@@ -235,13 +217,9 @@ fn to_lib_target(
235217 }
236218 vec ! [ CrateType :: ProcMacro ]
237219 }
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 ] ,
245223 } ;
246224
247225 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<()> {
869847 Some ( false ) => RustdocScrapeExamples :: Disabled ,
870848 Some ( true ) => RustdocScrapeExamples :: Enabled ,
871849 } )
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+
877852 if let Some ( edition) = toml. edition . clone ( ) {
878853 target. set_edition (
879854 edition
0 commit comments