|
1 |
| -use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
2 |
| -use rustc_data_structures::sso::SsoHashSet; |
| 1 | +use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexSet}; |
3 | 2 | use rustc_data_structures::stack::ensure_sufficient_stack;
|
4 | 3 | use rustc_hir::def_id::{DefId, LocalDefId};
|
5 | 4 | use rustc_middle::mir::TerminatorKind;
|
@@ -45,7 +44,10 @@ crate fn mir_callgraph_reachable<'tcx>(
|
45 | 44 | ) -> bool {
|
46 | 45 | trace!(%caller);
|
47 | 46 | for &(callee, substs) in tcx.mir_inliner_callees(caller.def) {
|
48 |
| - let substs = caller.subst_mir_and_normalize_erasing_regions(tcx, param_env, substs); |
| 47 | + let Ok(substs) = caller.try_subst_mir_and_normalize_erasing_regions(tcx, param_env, substs) else { |
| 48 | + trace!(?caller, ?param_env, ?substs, "cannot normalize, skipping"); |
| 49 | + continue; |
| 50 | + }; |
49 | 51 | let Some(callee) = ty::Instance::resolve(tcx, param_env, callee, substs).unwrap() else {
|
50 | 52 | trace!(?callee, "cannot resolve, skipping");
|
51 | 53 | continue;
|
@@ -150,7 +152,7 @@ crate fn mir_inliner_callees<'tcx>(
|
150 | 152 | // Functions from other crates and MIR shims
|
151 | 153 | _ => tcx.instance_mir(instance),
|
152 | 154 | };
|
153 |
| - let mut calls = SsoHashSet::new(); |
| 155 | + let mut calls = FxIndexSet::default(); |
154 | 156 | for bb_data in body.basic_blocks() {
|
155 | 157 | let terminator = bb_data.terminator();
|
156 | 158 | if let TerminatorKind::Call { func, .. } = &terminator.kind {
|
|
0 commit comments