@@ -402,7 +402,7 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
402
402
fn register_crate (
403
403
& mut self ,
404
404
host_lib : Option < Library > ,
405
- root : Option < & CratePaths > ,
405
+ dep_root : Option < & CratePaths > ,
406
406
lib : Library ,
407
407
dep_kind : CrateDepKind ,
408
408
name : Symbol ,
@@ -430,14 +430,14 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
430
430
// Maintain a reference to the top most crate.
431
431
// Stash paths for top-most crate locally if necessary.
432
432
let crate_paths;
433
- let root = if let Some ( root ) = root {
434
- root
433
+ let dep_root = if let Some ( dep_root ) = dep_root {
434
+ dep_root
435
435
} else {
436
436
crate_paths = CratePaths :: new ( crate_root. name ( ) , source. clone ( ) ) ;
437
437
& crate_paths
438
438
} ;
439
439
440
- let cnum_map = self . resolve_crate_deps ( root , & crate_root, & metadata, cnum, dep_kind) ?;
440
+ let cnum_map = self . resolve_crate_deps ( dep_root , & crate_root, & metadata, cnum, dep_kind) ?;
441
441
442
442
let raw_proc_macros = if crate_root. is_proc_macro_crate ( ) {
443
443
let temp_root;
@@ -559,15 +559,15 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
559
559
& ' b mut self ,
560
560
name : Symbol ,
561
561
mut dep_kind : CrateDepKind ,
562
- dep : Option < ( & ' b CratePaths , & ' b CrateDep ) > ,
562
+ dep_of : Option < ( & ' b CratePaths , & ' b CrateDep ) > ,
563
563
) -> Result < CrateNum , CrateError > {
564
564
info ! ( "resolving crate `{}`" , name) ;
565
565
if !name. as_str ( ) . is_ascii ( ) {
566
566
return Err ( CrateError :: NonAsciiName ( name) ) ;
567
567
}
568
- let ( root , hash, host_hash, extra_filename, path_kind, private_dep) = match dep {
569
- Some ( ( root , dep) ) => (
570
- Some ( root ) ,
568
+ let ( dep_root , hash, host_hash, extra_filename, path_kind, private_dep) = match dep_of {
569
+ Some ( ( dep_root , dep) ) => (
570
+ Some ( dep_root ) ,
571
571
Some ( dep. hash ) ,
572
572
dep. host_hash ,
573
573
Some ( & dep. extra_filename [ ..] ) ,
@@ -599,7 +599,7 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
599
599
dep_kind = CrateDepKind :: MacrosOnly ;
600
600
match self . load_proc_macro ( & mut locator, path_kind, host_hash) ? {
601
601
Some ( res) => res,
602
- None => return Err ( locator. into_error ( root . cloned ( ) ) ) ,
602
+ None => return Err ( locator. into_error ( dep_root . cloned ( ) ) ) ,
603
603
}
604
604
}
605
605
}
@@ -623,7 +623,7 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
623
623
}
624
624
( LoadResult :: Loaded ( library) , host_library) => {
625
625
info ! ( "register newly loaded library for `{}`" , name) ;
626
- self . register_crate ( host_library, root , library, dep_kind, name, private_dep)
626
+ self . register_crate ( host_library, dep_root , library, dep_kind, name, private_dep)
627
627
}
628
628
_ => panic ! ( ) ,
629
629
}
@@ -663,16 +663,20 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
663
663
} ) )
664
664
}
665
665
666
- // Go through the crate metadata and load any crates that it references
666
+ /// Go through the crate metadata and load any crates that it references.
667
667
fn resolve_crate_deps (
668
668
& mut self ,
669
- root : & CratePaths ,
669
+ dep_root : & CratePaths ,
670
670
crate_root : & CrateRoot ,
671
671
metadata : & MetadataBlob ,
672
672
krate : CrateNum ,
673
673
dep_kind : CrateDepKind ,
674
674
) -> Result < CrateNumMap , CrateError > {
675
- debug ! ( "resolving deps of external crate" ) ;
675
+ debug ! (
676
+ "resolving deps of external crate `{}` with dep root `{}`" ,
677
+ crate_root. name( ) ,
678
+ dep_root. name
679
+ ) ;
676
680
if crate_root. is_proc_macro_crate ( ) {
677
681
return Ok ( CrateNumMap :: new ( ) ) ;
678
682
}
@@ -685,14 +689,17 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
685
689
crate_num_map. push ( krate) ;
686
690
for dep in deps {
687
691
info ! (
688
- "resolving dep crate {} hash: `{}` extra filename: `{}`" ,
689
- dep. name, dep. hash, dep. extra_filename
692
+ "resolving dep `{}`->`{}` hash: `{}` extra filename: `{}`" ,
693
+ crate_root. name( ) ,
694
+ dep. name,
695
+ dep. hash,
696
+ dep. extra_filename
690
697
) ;
691
698
let dep_kind = match dep_kind {
692
699
CrateDepKind :: MacrosOnly => CrateDepKind :: MacrosOnly ,
693
700
_ => dep. kind ,
694
701
} ;
695
- let cnum = self . maybe_resolve_crate ( dep. name , dep_kind, Some ( ( root , & dep) ) ) ?;
702
+ let cnum = self . maybe_resolve_crate ( dep. name , dep_kind, Some ( ( dep_root , & dep) ) ) ?;
696
703
crate_num_map. push ( cnum) ;
697
704
}
698
705
0 commit comments