@@ -254,7 +254,7 @@ crate struct CrateLocator<'a> {
254
254
pub triple : TargetTriple ,
255
255
pub filesearch : FileSearch < ' a > ,
256
256
root : Option < & ' a CratePaths > ,
257
- pub is_proc_macro : Option < bool > ,
257
+ pub is_proc_macro : bool ,
258
258
259
259
// Mutable in-progress state or output.
260
260
rejected_via_hash : Vec < CrateMismatch > ,
@@ -304,7 +304,6 @@ impl<'a> CrateLocator<'a> {
304
304
is_host : bool ,
305
305
path_kind : PathKind ,
306
306
root : Option < & ' a CratePaths > ,
307
- is_proc_macro : Option < bool > ,
308
307
) -> CrateLocator < ' a > {
309
308
// The all loop is because `--crate-type=rlib --crate-type=rlib` is
310
309
// legal and produces both inside this type.
@@ -349,7 +348,7 @@ impl<'a> CrateLocator<'a> {
349
348
sess. target_filesearch ( path_kind)
350
349
} ,
351
350
root,
352
- is_proc_macro,
351
+ is_proc_macro : false ,
353
352
rejected_via_hash : Vec :: new ( ) ,
354
353
rejected_via_triple : Vec :: new ( ) ,
355
354
rejected_via_kind : Vec :: new ( ) ,
@@ -491,7 +490,7 @@ impl<'a> CrateLocator<'a> {
491
490
}
492
491
493
492
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 {
495
494
return true ;
496
495
}
497
496
@@ -623,15 +622,13 @@ impl<'a> CrateLocator<'a> {
623
622
}
624
623
625
624
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 ;
635
632
}
636
633
637
634
if self . exact_paths . is_empty ( ) && self . crate_name != root. name ( ) {
@@ -815,7 +812,6 @@ fn find_plugin_registrar_impl<'a>(
815
812
true , // is_host
816
813
PathKind :: Crate ,
817
814
None , // root
818
- None , // is_proc_macro
819
815
) ;
820
816
821
817
match locator. maybe_load_library_crate ( ) ? {
0 commit comments