@@ -41,7 +41,6 @@ use rustc::middle::trans::{Linkage, Visibility, Stats};
41
41
use rustc:: middle:: cstore:: { EncodedMetadata , EncodedMetadataHashes } ;
42
42
use rustc:: ty:: { self , Ty , TyCtxt } ;
43
43
use rustc:: ty:: maps:: Providers ;
44
- use rustc:: dep_graph:: AssertDepGraphSafe ;
45
44
use rustc:: middle:: cstore:: { self , LinkMeta , LinkagePreference } ;
46
45
use rustc:: hir:: map as hir_map;
47
46
use rustc:: util:: common:: { time, print_time_passes_entry} ;
@@ -894,7 +893,7 @@ fn iter_globals(llmod: llvm::ModuleRef) -> ValueIter {
894
893
/// This list is later used by linkers to determine the set of symbols needed to
895
894
/// be exposed from a dynamic library and it's also encoded into the metadata.
896
895
pub fn find_exported_symbols ( tcx : TyCtxt ) -> NodeSet {
897
- tcx. reachable_set ( LOCAL_CRATE ) . iter ( ) . cloned ( ) . filter ( |& id| {
896
+ tcx. reachable_set ( LOCAL_CRATE ) . 0 . iter ( ) . cloned ( ) . filter ( |& id| {
898
897
// Next, we want to ignore some FFI functions that are not exposed from
899
898
// this crate. Reachable FFI functions can be lumped into two
900
899
// categories:
@@ -1370,8 +1369,8 @@ fn compile_codegen_unit<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
1370
1369
let dep_node = cgu. work_product_dep_node ( ) ;
1371
1370
let ( ( stats, module) , _) =
1372
1371
tcx. dep_graph . with_task ( dep_node,
1373
- AssertDepGraphSafe ( tcx) ,
1374
- AssertDepGraphSafe ( cgu) ,
1372
+ tcx,
1373
+ cgu,
1375
1374
module_translation) ;
1376
1375
let time_to_translate = start_time. elapsed ( ) ;
1377
1376
@@ -1392,14 +1391,10 @@ fn compile_codegen_unit<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
1392
1391
return stats;
1393
1392
1394
1393
fn module_translation < ' a , ' tcx > (
1395
- tcx : AssertDepGraphSafe < TyCtxt < ' a , ' tcx , ' tcx > > ,
1396
- args : AssertDepGraphSafe < Arc < CodegenUnit < ' tcx > > > )
1394
+ tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
1395
+ cgu : Arc < CodegenUnit < ' tcx > > )
1397
1396
-> ( Stats , ModuleTranslation )
1398
1397
{
1399
- // FIXME(#40304): We ought to be using the id as a key and some queries, I think.
1400
- let AssertDepGraphSafe ( tcx) = tcx;
1401
- let AssertDepGraphSafe ( cgu) = args;
1402
-
1403
1398
let cgu_name = cgu. name ( ) . to_string ( ) ;
1404
1399
let cgu_id = cgu. work_product_id ( ) ;
1405
1400
let symbol_name_hash = cgu. compute_symbol_name_hash ( tcx) ;
@@ -1564,6 +1559,7 @@ pub fn visibility_to_llvm(linkage: Visibility) -> llvm::Visibility {
1564
1559
Visibility :: Default => llvm:: Visibility :: Default ,
1565
1560
Visibility :: Hidden => llvm:: Visibility :: Hidden ,
1566
1561
Visibility :: Protected => llvm:: Visibility :: Protected ,
1562
+ }
1567
1563
}
1568
1564
1569
1565
// FIXME(mw): Anything that is produced via DepGraph::with_task() must implement
@@ -1577,17 +1573,8 @@ pub fn visibility_to_llvm(linkage: Visibility) -> llvm::Visibility {
1577
1573
mod temp_stable_hash_impls {
1578
1574
use rustc_data_structures:: stable_hasher:: { StableHasherResult , StableHasher ,
1579
1575
HashStable } ;
1580
- use context:: Stats ;
1581
1576
use ModuleTranslation ;
1582
1577
1583
- impl < HCX > HashStable < HCX > for Stats {
1584
- fn hash_stable < W : StableHasherResult > ( & self ,
1585
- _: & mut HCX ,
1586
- _: & mut StableHasher < W > ) {
1587
- // do nothing
1588
- }
1589
- }
1590
-
1591
1578
impl < HCX > HashStable < HCX > for ModuleTranslation {
1592
1579
fn hash_stable < W : StableHasherResult > ( & self ,
1593
1580
_: & mut HCX ,
0 commit comments