Auto merge of #89000 - Mark-Simulacrum:no-new-lrc, r=petrochenkov

Reuse existing shared Lrc for MatchImpl parent

This is a small performance win for the hot path, which helps to address this regression: https://github.com/rust-lang/rust/pull/87244#issuecomment-883635813.
This commit is contained in:
bors 2021-09-18 20:13:21 +00:00
commit aa8f2d432b
4 changed files with 4 additions and 4 deletions

View file

@ -2034,7 +2034,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