@@ -254,7 +254,7 @@ crate struct CrateLocator<'a> {
254254 pub triple : TargetTriple ,
255255 pub filesearch : FileSearch < ' a > ,
256256 root : Option < & ' a CratePaths > ,
257- pub is_proc_macro : Option < bool > ,
257+ pub is_proc_macro : bool ,
258258
259259 // Mutable in-progress state or output.
260260 rejected_via_hash : Vec < CrateMismatch > ,
@@ -304,7 +304,6 @@ impl<'a> CrateLocator<'a> {
304304 is_host : bool ,
305305 path_kind : PathKind ,
306306 root : Option < & ' a CratePaths > ,
307- is_proc_macro : Option < bool > ,
308307 ) -> CrateLocator < ' a > {
309308 // The all loop is because `--crate-type=rlib --crate-type=rlib` is
310309 // legal and produces both inside this type.
@@ -349,7 +348,7 @@ impl<'a> CrateLocator<'a> {
349348 sess. target_filesearch ( path_kind)
350349 } ,
351350 root,
352- is_proc_macro,
351+ is_proc_macro : false ,
353352 rejected_via_hash : Vec :: new ( ) ,
354353 rejected_via_triple : Vec :: new ( ) ,
355354 rejected_via_kind : Vec :: new ( ) ,
@@ -491,7 +490,7 @@ impl<'a> CrateLocator<'a> {
491490 }
492491
493492 fn needs_crate_flavor ( & self , flavor : CrateFlavor ) -> bool {
494- if flavor == CrateFlavor :: Dylib && self . is_proc_macro == Some ( true ) {
493+ if flavor == CrateFlavor :: Dylib && self . is_proc_macro {
495494 return true ;
496495 }
497496
@@ -623,15 +622,13 @@ impl<'a> CrateLocator<'a> {
623622 }
624623
625624 let root = metadata. get_root ( ) ;
626- if let Some ( expected_is_proc_macro) = self . is_proc_macro {
627- let is_proc_macro = root. is_proc_macro_crate ( ) ;
628- if is_proc_macro != expected_is_proc_macro {
629- info ! (
630- "Rejecting via proc macro: expected {} got {}" ,
631- expected_is_proc_macro, is_proc_macro
632- ) ;
633- return None ;
634- }
625+ if root. is_proc_macro_crate ( ) != self . is_proc_macro {
626+ info ! (
627+ "Rejecting via proc macro: expected {} got {}" ,
628+ self . is_proc_macro,
629+ root. is_proc_macro_crate( ) ,
630+ ) ;
631+ return None ;
635632 }
636633
637634 if self . exact_paths . is_empty ( ) && self . crate_name != root. name ( ) {
@@ -815,7 +812,6 @@ fn find_plugin_registrar_impl<'a>(
815812 true , // is_host
816813 PathKind :: Crate ,
817814 None , // root
818- None , // is_proc_macro
819815 ) ;
820816
821817 match locator. maybe_load_library_crate ( ) ? {
0 commit comments