Reuse existing shared Lrc for MatchImpl parent

This is hopefully a small performance win for the hot path.
This commit is contained in:
Mark Rousskov 2021-09-15 22:58:40 -04:00
parent 4aed1abb70
commit 905beab38e
4 changed files with 4 additions and 4 deletions

View file

@ -2025,7 +2025,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
let cause = ObligationCause::new(
obligation.cause.span,
obligation.cause.body_id,
ObligationCauseCode::MatchImpl(Lrc::new(obligation.cause.code.clone()), impl_def_id),
ObligationCauseCode::MatchImpl(obligation.cause.clone(), impl_def_id),
);
let InferOk { obligations, .. } = self