Reuse existing shared Lrc for MatchImpl parent
This is hopefully a small performance win for the hot path.
This commit is contained in:
parent
4aed1abb70
commit
905beab38e
4 changed files with 4 additions and 4 deletions
|
@ -33,7 +33,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
|
|||
ObligationCauseCode::MatchImpl(parent, impl_def_id) => (parent, impl_def_id),
|
||||
_ => return None,
|
||||
};
|
||||
let binding_span = match **parent {
|
||||
let binding_span = match parent.code {
|
||||
ObligationCauseCode::BindingObligation(_def_id, binding_span) => binding_span,
|
||||
_ => return None,
|
||||
};
|
||||
|
|
|
@ -189,7 +189,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
|
|||
}
|
||||
if let SubregionOrigin::Subtype(box TypeTrace { cause, .. }) = &sub_origin {
|
||||
let code = match &cause.code {
|
||||
ObligationCauseCode::MatchImpl(parent, ..) => &**parent,
|
||||
ObligationCauseCode::MatchImpl(parent, ..) => &parent.code,
|
||||
_ => &cause.code,
|
||||
};
|
||||
if let ObligationCauseCode::ItemObligation(item_def_id) = *code {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue