Auto merge of #65172 - tanriol:explain_borrow-use-context-dominators, r=nagisa
use precalculated dominators in explain_borrow This looks like the only place calculating dominators from the MIR body every time instead of using the ones stored on the `MirBorrowckCtxt`. For example, in rust-lang/rust#65131 a big generated function with a number of borrowck errors takes a few hours(!) recalculating the dominators while explaining the errors. I don't know enough about this part of rustc codebase to know for sure that this change is correct, but no tests seem to fail as a result of this change in local testing.
This commit is contained in:
commit
53aca553ec
1 changed files with 1 additions and 1 deletions
|
@ -458,7 +458,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
/// True if an edge `source -> target` is a backedge -- in other words, if the target
|
||||
/// dominates the source.
|
||||
fn is_back_edge(&self, source: Location, target: Location) -> bool {
|
||||
target.dominates(source, &self.body.dominators())
|
||||
target.dominates(source, &self.dominators)
|
||||
}
|
||||
|
||||
/// Determine how the borrow was later used.
|
||||
|
|
Loading…
Add table
Reference in a new issue