Skip to content

Commit c600a8e

Browse files
committed
rename variable
1 parent f0ba469 commit c600a8e

File tree

1 file changed

+23
-21
lines changed
  • compiler/rustc_trait_selection/src/traits

1 file changed

+23
-21
lines changed

compiler/rustc_trait_selection/src/traits/mod.rs

+23-21
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ fn do_normalize_predicates<'tcx>(
221221
mut causes: impl Iterator<Item = ObligationCause<'tcx>> + Debug,
222222
elaborated_env: ty::ParamEnv<'tcx>,
223223
predicates: Vec<ty::Predicate<'tcx>>,
224-
outlives: bool,
224+
normalize_outlive_predicates: bool,
225225
) -> Result<Vec<ty::Predicate<'tcx>>, ErrorGuaranteed> {
226226
// FIXME. We should really... do something with these region
227227
// obligations. But this call just continues the older
@@ -237,24 +237,27 @@ fn do_normalize_predicates<'tcx>(
237237
// them here too, and we will remove this function when
238238
// we move over to lazy normalization *anyway*.
239239
tcx.infer_ctxt().ignoring_regions().enter(|infcx| {
240-
let predicates = match predicates.try_map_id(|predicate| {
241-
if outlives
242-
!= matches!(predicate.kind().skip_binder(), ty::PredicateKind::TypeOutlives(..))
240+
let normalized_predicates = match predicates.try_map_id(|origin_predicate| {
241+
if normalize_outlive_predicates
242+
!= matches!(
243+
origin_predicate.kind().skip_binder(),
244+
ty::PredicateKind::TypeOutlives(..)
245+
)
243246
{
244247
causes.next().unwrap();
245-
Ok(predicate)
248+
Ok(origin_predicate)
246249
} else {
247-
fully_normalize(&infcx, causes.next().unwrap(), elaborated_env, predicate)
250+
fully_normalize(&infcx, causes.next().unwrap(), elaborated_env, origin_predicate)
248251
}
249252
}) {
250-
Ok(predicates) => predicates,
253+
Ok(normalized) => normalized,
251254
Err(errors) => {
252255
let reported = infcx.report_fulfillment_errors(&errors, None, false);
253256
return Err(reported);
254257
}
255258
};
256259

257-
debug!("do_normalize_predictes: normalized predicates = {:?}", predicates);
260+
debug!("do_normalize_predictes: normalized predicates = {:?}", normalized_predicates);
258261

259262
// We can use the `elaborated_env` here; the region code only
260263
// cares about declarations like `'a: 'b`.
@@ -273,17 +276,17 @@ fn do_normalize_predicates<'tcx>(
273276
);
274277
}
275278

276-
match predicates.try_map_id(|predicate| {
277-
if outlives
278-
!= matches!(predicate.kind().skip_binder(), ty::PredicateKind::TypeOutlives(..))
279-
{
280-
Ok(predicate)
281-
} else {
282-
infcx.fully_resolve(predicate)
283-
}
284-
}) {
285-
Ok(predicates) => Ok(predicates),
286-
Err(fixup_err) => {
279+
normalized_predicates
280+
.try_map_id(|predicate| {
281+
if normalize_outlive_predicates
282+
!= matches!(predicate.kind().skip_binder(), ty::PredicateKind::TypeOutlives(..))
283+
{
284+
Ok(predicate)
285+
} else {
286+
infcx.fully_resolve(predicate)
287+
}
288+
})
289+
.map_err(|fixup_err| {
287290
// If we encounter a fixup error, it means that some type
288291
// variable wound up unconstrained. I actually don't know
289292
// if this can happen, and I certainly don't expect it to
@@ -298,8 +301,7 @@ fn do_normalize_predicates<'tcx>(
298301
"inference variables in normalized parameter environment: {}",
299302
fixup_err
300303
);
301-
}
302-
}
304+
})
303305
})
304306
}
305307

0 commit comments

Comments
 (0)