@@ -13,7 +13,7 @@ use index_builder::{FromId, IndexBuilder, Untracked};
1313use isolated_encoder:: IsolatedEncoder ;
1414use schema:: * ;
1515
16- use rustc:: middle:: cstore:: { LinkMeta , LinkagePreference , NativeLibrary ,
16+ use rustc:: middle:: cstore:: { LinkagePreference , NativeLibrary ,
1717 EncodedMetadata , ForeignModule } ;
1818use rustc:: hir:: def:: CtorKind ;
1919use rustc:: hir:: def_id:: { CrateNum , CRATE_DEF_INDEX , DefIndex , DefId , LocalDefId , LOCAL_CRATE } ;
@@ -52,7 +52,6 @@ use rustc::hir::intravisit;
5252pub struct EncodeContext < ' a , ' tcx : ' a > {
5353 opaque : opaque:: Encoder ,
5454 pub tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
55- link_meta : & ' a LinkMeta ,
5655
5756 lazy_state : LazyState ,
5857 type_shorthands : FxHashMap < Ty < ' tcx > , usize > ,
@@ -482,7 +481,6 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
482481 let index_bytes = self . position ( ) - i;
483482
484483 let attrs = tcx. hir . krate_attrs ( ) ;
485- let link_meta = self . link_meta ;
486484 let is_proc_macro = tcx. sess . crate_types . borrow ( ) . contains ( & CrateType :: ProcMacro ) ;
487485 let has_default_lib_allocator = attr:: contains_name ( & attrs, "default_lib_allocator" ) ;
488486 let has_global_allocator = * tcx. sess . has_global_allocator . get ( ) ;
@@ -491,7 +489,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
491489 name : tcx. crate_name ( LOCAL_CRATE ) ,
492490 extra_filename : tcx. sess . opts . cg . extra_filename . clone ( ) ,
493491 triple : tcx. sess . opts . target_triple . clone ( ) ,
494- hash : link_meta . crate_hash ,
492+ hash : tcx . crate_hash ( LOCAL_CRATE ) ,
495493 disambiguator : tcx. sess . local_crate_disambiguator ( ) ,
496494 panic_strategy : tcx. sess . panic_strategy ( ) ,
497495 edition : hygiene:: default_edition ( ) ,
@@ -1824,8 +1822,7 @@ impl<'a, 'tcx, 'v> ItemLikeVisitor<'v> for ImplVisitor<'a, 'tcx> {
18241822// will allow us to slice the metadata to the precise length that we just
18251823// generated regardless of trailing bytes that end up in it.
18261824
1827- pub fn encode_metadata < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
1828- link_meta : & LinkMeta )
1825+ pub fn encode_metadata < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > )
18291826 -> EncodedMetadata
18301827{
18311828 let mut encoder = opaque:: Encoder :: new ( vec ! [ ] ) ;
@@ -1838,7 +1835,6 @@ pub fn encode_metadata<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
18381835 let mut ecx = EncodeContext {
18391836 opaque : encoder,
18401837 tcx,
1841- link_meta,
18421838 lazy_state : LazyState :: NoNode ,
18431839 type_shorthands : Default :: default ( ) ,
18441840 predicate_shorthands : Default :: default ( ) ,
0 commit comments