11
11
//! Validates all used crates and extern libraries and loads their metadata
12
12
13
13
use cstore:: { self , CStore , CrateSource , MetadataBlob } ;
14
- use loader :: { self , CratePaths } ;
14
+ use locator :: { self , CratePaths } ;
15
15
use macro_import;
16
16
use schema:: CrateRoot ;
17
17
@@ -352,7 +352,7 @@ impl<'a> CrateLoader<'a> {
352
352
Some ( cnum) => LoadResult :: Previous ( cnum) ,
353
353
None => {
354
354
info ! ( "falling back to a load" ) ;
355
- let mut load_ctxt = loader :: Context {
355
+ let mut locate_ctxt = locator :: Context {
356
356
sess : self . sess ,
357
357
span : span,
358
358
ident : ident,
@@ -368,9 +368,9 @@ impl<'a> CrateLoader<'a> {
368
368
rejected_via_version : vec ! ( ) ,
369
369
should_match_name : true ,
370
370
} ;
371
- match self . load ( & mut load_ctxt ) {
371
+ match self . load ( & mut locate_ctxt ) {
372
372
Some ( result) => result,
373
- None => load_ctxt . report_load_errs ( ) ,
373
+ None => locate_ctxt . report_errs ( ) ,
374
374
}
375
375
}
376
376
} ;
@@ -390,8 +390,8 @@ impl<'a> CrateLoader<'a> {
390
390
}
391
391
}
392
392
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 ( ) {
395
395
Some ( lib) => lib,
396
396
None => return None ,
397
397
} ;
@@ -405,11 +405,11 @@ impl<'a> CrateLoader<'a> {
405
405
// don't want to match a host crate against an equivalent target one
406
406
// already loaded.
407
407
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 {
409
409
let mut result = LoadResult :: Loaded ( library) ;
410
410
self . cstore . iter_crate_data ( |cnum, data| {
411
411
if data. name ( ) == root. name && root. hash == data. hash ( ) {
412
- assert ! ( loader . hash. is_none( ) ) ;
412
+ assert ! ( locate_ctxt . hash. is_none( ) ) ;
413
413
info ! ( "load success, going to previous cnum: {}" , cnum) ;
414
414
result = LoadResult :: Previous ( cnum) ;
415
415
}
@@ -494,7 +494,7 @@ impl<'a> CrateLoader<'a> {
494
494
let mut target_only = false ;
495
495
let ident = info. ident . clone ( ) ;
496
496
let name = info. name . clone ( ) ;
497
- let mut load_ctxt = loader :: Context {
497
+ let mut locate_ctxt = locator :: Context {
498
498
sess : self . sess ,
499
499
span : span,
500
500
ident : & ident[ ..] ,
@@ -510,7 +510,7 @@ impl<'a> CrateLoader<'a> {
510
510
rejected_via_version : vec ! ( ) ,
511
511
should_match_name : true ,
512
512
} ;
513
- let library = self . load ( & mut load_ctxt ) . or_else ( || {
513
+ let library = self . load ( & mut locate_ctxt ) . or_else ( || {
514
514
if !is_cross {
515
515
return None
516
516
}
@@ -519,15 +519,15 @@ impl<'a> CrateLoader<'a> {
519
519
target_only = true ;
520
520
should_link = info. should_link ;
521
521
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 ) ;
525
525
526
- self . load ( & mut load_ctxt )
526
+ self . load ( & mut locate_ctxt )
527
527
} ) ;
528
528
let library = match library {
529
529
Some ( l) => l,
530
- None => load_ctxt . report_load_errs ( ) ,
530
+ None => locate_ctxt . report_errs ( ) ,
531
531
} ;
532
532
533
533
let ( dylib, metadata) = match library {
0 commit comments