1111//! Validates all used crates and extern libraries and loads their metadata
1212
1313use cstore:: { self , CStore , CrateSource , MetadataBlob } ;
14- use loader :: { self , CratePaths } ;
14+ use locator :: { self , CratePaths } ;
1515use macro_import;
1616use schema:: CrateRoot ;
1717
@@ -352,7 +352,7 @@ impl<'a> CrateLoader<'a> {
352352 Some ( cnum) => LoadResult :: Previous ( cnum) ,
353353 None => {
354354 info ! ( "falling back to a load" ) ;
355- let mut load_ctxt = loader :: Context {
355+ let mut locate_ctxt = locator :: Context {
356356 sess : self . sess ,
357357 span : span,
358358 ident : ident,
@@ -368,9 +368,9 @@ impl<'a> CrateLoader<'a> {
368368 rejected_via_version : vec ! ( ) ,
369369 should_match_name : true ,
370370 } ;
371- match self . load ( & mut load_ctxt ) {
371+ match self . load ( & mut locate_ctxt ) {
372372 Some ( result) => result,
373- None => load_ctxt . report_load_errs ( ) ,
373+ None => locate_ctxt . report_errs ( ) ,
374374 }
375375 }
376376 } ;
@@ -390,8 +390,8 @@ impl<'a> CrateLoader<'a> {
390390 }
391391 }
392392
393- fn load ( & mut self , loader : & mut loader :: Context ) -> Option < LoadResult > {
394- let library = match loader . maybe_load_library_crate ( ) {
393+ fn load ( & mut self , locate_ctxt : & mut locator :: Context ) -> Option < LoadResult > {
394+ let library = match locate_ctxt . maybe_load_library_crate ( ) {
395395 Some ( lib) => lib,
396396 None => return None ,
397397 } ;
@@ -405,11 +405,11 @@ impl<'a> CrateLoader<'a> {
405405 // don't want to match a host crate against an equivalent target one
406406 // already loaded.
407407 let root = library. metadata . get_root ( ) ;
408- if loader . triple == self . sess . opts . target_triple {
408+ if locate_ctxt . triple == self . sess . opts . target_triple {
409409 let mut result = LoadResult :: Loaded ( library) ;
410410 self . cstore . iter_crate_data ( |cnum, data| {
411411 if data. name ( ) == root. name && root. hash == data. hash ( ) {
412- assert ! ( loader . hash. is_none( ) ) ;
412+ assert ! ( locate_ctxt . hash. is_none( ) ) ;
413413 info ! ( "load success, going to previous cnum: {}" , cnum) ;
414414 result = LoadResult :: Previous ( cnum) ;
415415 }
@@ -494,7 +494,7 @@ impl<'a> CrateLoader<'a> {
494494 let mut target_only = false ;
495495 let ident = info. ident . clone ( ) ;
496496 let name = info. name . clone ( ) ;
497- let mut load_ctxt = loader :: Context {
497+ let mut locate_ctxt = locator :: Context {
498498 sess : self . sess ,
499499 span : span,
500500 ident : & ident[ ..] ,
@@ -510,7 +510,7 @@ impl<'a> CrateLoader<'a> {
510510 rejected_via_version : vec ! ( ) ,
511511 should_match_name : true ,
512512 } ;
513- let library = self . load ( & mut load_ctxt ) . or_else ( || {
513+ let library = self . load ( & mut locate_ctxt ) . or_else ( || {
514514 if !is_cross {
515515 return None
516516 }
@@ -519,15 +519,15 @@ impl<'a> CrateLoader<'a> {
519519 target_only = true ;
520520 should_link = info. should_link ;
521521
522- load_ctxt . target = & self . sess . target . target ;
523- load_ctxt . triple = target_triple;
524- load_ctxt . filesearch = self . sess . target_filesearch ( PathKind :: Crate ) ;
522+ locate_ctxt . target = & self . sess . target . target ;
523+ locate_ctxt . triple = target_triple;
524+ locate_ctxt . filesearch = self . sess . target_filesearch ( PathKind :: Crate ) ;
525525
526- self . load ( & mut load_ctxt )
526+ self . load ( & mut locate_ctxt )
527527 } ) ;
528528 let library = match library {
529529 Some ( l) => l,
530- None => load_ctxt . report_load_errs ( ) ,
530+ None => locate_ctxt . report_errs ( ) ,
531531 } ;
532532
533533 let ( dylib, metadata) = match library {
0 commit comments