Skip to content

Commit a6d3841

Browse files
committed
Review feedback: Move match to before cause computation
1 parent 90a3999 commit a6d3841

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,6 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
399399

400400
let origin_longer = self.regioncx.definitions[longer_fr].origin;
401401

402-
// Find the code to blame for the fact that `longer_fr` outlives `error_fr`.
403-
let cause =
404-
self.regioncx.best_blame_constraint(longer_fr, origin_longer, error_vid).0.cause;
405-
406402
let Placeholder(placeholder) = origin_longer else {
407403
bug!("Expected {longer_fr:?} to come from placeholder!");
408404
};
@@ -413,6 +409,10 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
413409
Placeholder(other_placeholder) => Some(other_placeholder),
414410
};
415411

412+
// Find the code to blame for the fact that `longer_fr` outlives `error_fr`.
413+
let cause =
414+
self.regioncx.best_blame_constraint(longer_fr, origin_longer, error_vid).0.cause;
415+
416416
// FIXME these methods should have better names, and also probably not be this generic.
417417
// FIXME note that we *throw away* the error element here! We probably want to
418418
// thread it through the computation further down and use it, but there currently isn't

0 commit comments

Comments
 (0)