move generics_of call outside of iter
This commit is contained in:
parent
796cb8031d
commit
ed8e436916
1 changed files with 3 additions and 1 deletions
|
@ -1998,6 +1998,8 @@ impl ExplicitOutlivesRequirements {
|
|||
) -> Vec<(usize, Span)> {
|
||||
use rustc_middle::middle::resolve_bound_vars::ResolvedArg;
|
||||
|
||||
let item_generics = tcx.generics_of(item);
|
||||
|
||||
bounds
|
||||
.iter()
|
||||
.enumerate()
|
||||
|
@ -2009,7 +2011,7 @@ impl ExplicitOutlivesRequirements {
|
|||
let is_inferred = match tcx.named_bound_var(lifetime.hir_id) {
|
||||
Some(ResolvedArg::EarlyBound(def_id)) => inferred_outlives
|
||||
.iter()
|
||||
.any(|r| matches!(**r, ty::ReEarlyParam(ebr) if { tcx.generics_of(item).region_param(ebr, tcx).def_id == def_id })),
|
||||
.any(|r| matches!(**r, ty::ReEarlyParam(ebr) if { item_generics.region_param(ebr, tcx).def_id == def_id })),
|
||||
_ => false,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue