Optimize plug_leaks.
This commit avoids the `fold_regions` call in `plug_leaks` when `skol_map` is empty, which is the common case. This gives speed-ups of up to 1.14x on some of the rustc-benchmarks.
This commit is contained in:
parent
8ccfc695b5
commit
1fece3d84b
1 changed files with 4 additions and 3 deletions
|
@ -756,6 +756,10 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
|
|||
skol_map,
|
||||
value);
|
||||
|
||||
if skol_map.is_empty() {
|
||||
return self.resolve_type_vars_if_possible(value);
|
||||
}
|
||||
|
||||
// Compute a mapping from the "taint set" of each skolemized
|
||||
// region back to the `ty::BoundRegion` that it originally
|
||||
// represented. Because `leak_check` passed, we know that
|
||||
|
@ -813,9 +817,6 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
|
|||
}
|
||||
});
|
||||
|
||||
debug!("plug_leaks: result={:?}",
|
||||
result);
|
||||
|
||||
self.pop_skolemized(skol_map, snapshot);
|
||||
|
||||
debug!("plug_leaks: result={:?}", result);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue