@@ -13,7 +13,7 @@ use index_builder::{FromId, IndexBuilder, Untracked};
13
13
use isolated_encoder:: IsolatedEncoder ;
14
14
use schema:: * ;
15
15
16
- use rustc:: middle:: cstore:: { LinkMeta , LinkagePreference , NativeLibrary ,
16
+ use rustc:: middle:: cstore:: { LinkagePreference , NativeLibrary ,
17
17
EncodedMetadata , ForeignModule } ;
18
18
use rustc:: hir:: def:: CtorKind ;
19
19
use rustc:: hir:: def_id:: { CrateNum , CRATE_DEF_INDEX , DefIndex , DefId , LocalDefId , LOCAL_CRATE } ;
@@ -52,7 +52,6 @@ use rustc::hir::intravisit;
52
52
pub struct EncodeContext < ' a , ' tcx : ' a > {
53
53
opaque : opaque:: Encoder ,
54
54
pub tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
55
- link_meta : & ' a LinkMeta ,
56
55
57
56
lazy_state : LazyState ,
58
57
type_shorthands : FxHashMap < Ty < ' tcx > , usize > ,
@@ -482,7 +481,6 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
482
481
let index_bytes = self . position ( ) - i;
483
482
484
483
let attrs = tcx. hir . krate_attrs ( ) ;
485
- let link_meta = self . link_meta ;
486
484
let is_proc_macro = tcx. sess . crate_types . borrow ( ) . contains ( & CrateType :: ProcMacro ) ;
487
485
let has_default_lib_allocator = attr:: contains_name ( & attrs, "default_lib_allocator" ) ;
488
486
let has_global_allocator = * tcx. sess . has_global_allocator . get ( ) ;
@@ -491,7 +489,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
491
489
name : tcx. crate_name ( LOCAL_CRATE ) ,
492
490
extra_filename : tcx. sess . opts . cg . extra_filename . clone ( ) ,
493
491
triple : tcx. sess . opts . target_triple . clone ( ) ,
494
- hash : link_meta . crate_hash ,
492
+ hash : tcx . crate_hash ( LOCAL_CRATE ) ,
495
493
disambiguator : tcx. sess . local_crate_disambiguator ( ) ,
496
494
panic_strategy : tcx. sess . panic_strategy ( ) ,
497
495
edition : hygiene:: default_edition ( ) ,
@@ -1824,8 +1822,7 @@ impl<'a, 'tcx, 'v> ItemLikeVisitor<'v> for ImplVisitor<'a, 'tcx> {
1824
1822
// will allow us to slice the metadata to the precise length that we just
1825
1823
// generated regardless of trailing bytes that end up in it.
1826
1824
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 > )
1829
1826
-> EncodedMetadata
1830
1827
{
1831
1828
let mut encoder = opaque:: Encoder :: new ( vec ! [ ] ) ;
@@ -1838,7 +1835,6 @@ pub fn encode_metadata<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
1838
1835
let mut ecx = EncodeContext {
1839
1836
opaque : encoder,
1840
1837
tcx,
1841
- link_meta,
1842
1838
lazy_state : LazyState :: NoNode ,
1843
1839
type_shorthands : Default :: default ( ) ,
1844
1840
predicate_shorthands : Default :: default ( ) ,
0 commit comments