diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2021-09-15 22:58:40 -0400 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2021-09-15 22:58:40 -0400 |
| commit | 905beab38ead75dcc283c641ebdaf84450e6e3c2 (patch) | |
| tree | 63b679c780825e321957fe54dfabff5baa096bde /compiler/rustc_infer/src/infer | |
| parent | 4aed1abb706a31331fd8b612ca400935aeddd0e0 (diff) | |
| download | rust-905beab38ead75dcc283c641ebdaf84450e6e3c2.tar.gz rust-905beab38ead75dcc283c641ebdaf84450e6e3c2.zip | |
Reuse existing shared Lrc for MatchImpl parent
This is hopefully a small performance win for the hot path.
Diffstat (limited to 'compiler/rustc_infer/src/infer')
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/mismatched_static_lifetime.rs b/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/mismatched_static_lifetime.rs index c60a7149e40..dec5e93a026 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/mismatched_static_lifetime.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/mismatched_static_lifetime.rs @@ -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, }; diff --git a/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs b/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs index 81059fbcb10..2d47e72780e 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs @@ -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 { |
