@@ -1116,7 +1116,7 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
1116
1116
let dep_node = cgu. work_product_dep_node ( ) ;
1117
1117
let ( ( stats, module) , _) =
1118
1118
tcx. dep_graph . with_task ( dep_node,
1119
- AssertDepGraphSafe ( & shared_ccx) ,
1119
+ & shared_ccx,
1120
1120
AssertDepGraphSafe ( ( cgu,
1121
1121
translation_items. clone ( ) ,
1122
1122
exported_symbols. clone ( ) ) ) ,
@@ -1159,14 +1159,13 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
1159
1159
}
1160
1160
1161
1161
fn module_translation < ' a , ' tcx > (
1162
- scx : AssertDepGraphSafe < & SharedCrateContext < ' a , ' tcx > > ,
1162
+ scx : & SharedCrateContext < ' a , ' tcx > ,
1163
1163
args : AssertDepGraphSafe < ( CodegenUnit < ' tcx > ,
1164
1164
Arc < FxHashSet < TransItem < ' tcx > > > ,
1165
1165
Arc < ExportedSymbols > ) > )
1166
1166
-> ( Stats , ModuleTranslation )
1167
1167
{
1168
1168
// FIXME(#40304): We ought to be using the id as a key and some queries, I think.
1169
- let AssertDepGraphSafe ( scx) = scx;
1170
1169
let AssertDepGraphSafe ( ( cgu, crate_trans_items, exported_symbols) ) = args;
1171
1170
1172
1171
let cgu_name = String :: from ( cgu. name ( ) ) ;
@@ -1502,3 +1501,34 @@ fn collect_and_partition_translation_items<'a, 'tcx>(scx: &SharedCrateContext<'a
1502
1501
1503
1502
( translation_items, codegen_units)
1504
1503
}
1504
+
1505
+ // FIXME(mw): Anything that is produced via DepGraph::with_task() must implement
1506
+ // the HashStable trait. Normally DepGraph::with_task() calls are
1507
+ // hidden behind queries, but CGU creation is a special case in two
1508
+ // ways: (1) it's not a query and (2) CGU are output nodes, so their
1509
+ // Fingerprints are not actually needed. It remains to be clarified
1510
+ // how exactly this case will be handled in the red/green system but
1511
+ // for now we content ourselves with providing a no-op HashStable
1512
+ // implementation for CGUs.
1513
+ mod temp_stable_hash_impls {
1514
+ use rustc_data_structures:: stable_hasher:: { StableHasherResult , StableHasher ,
1515
+ HashStable } ;
1516
+ use context:: Stats ;
1517
+ use ModuleTranslation ;
1518
+
1519
+ impl < HCX > HashStable < HCX > for Stats {
1520
+ fn hash_stable < W : StableHasherResult > ( & self ,
1521
+ _: & mut HCX ,
1522
+ _: & mut StableHasher < W > ) {
1523
+ // do nothing
1524
+ }
1525
+ }
1526
+
1527
+ impl < HCX > HashStable < HCX > for ModuleTranslation {
1528
+ fn hash_stable < W : StableHasherResult > ( & self ,
1529
+ _: & mut HCX ,
1530
+ _: & mut StableHasher < W > ) {
1531
+ // do nothing
1532
+ }
1533
+ }
1534
+ }
0 commit comments