Skip to content

Commit dd884e4

Browse files
committed
entirely ignore region errors in normalize_predicates
the old solver doesn't register `TypeOutlives` and `RegionOutlives` goals if `ignoring_regions` is set. The new solver always registers these requirements, so we instead ignore errors caused by these constraints.
1 parent cf852ee commit dd884e4

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

  • compiler/rustc_trait_selection/src/traits

‎compiler/rustc_trait_selection/src/traits/mod.rs‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,17 +284,17 @@ fn do_normalize_predicates<'tcx>(
284284

285285
// We can use the `elaborated_env` here; the region code only
286286
// cares about declarations like `'a: 'b`.
287+
//
287288
// FIXME: It's very weird that we ignore region obligations but apparently
288289
// still need to use `resolve_regions` as we need the resolved regions in
289290
// the normalized predicates.
290-
let errors = infcx.resolve_regions(cause.body_id, elaborated_env, []);
291-
if !errors.is_empty() {
292-
tcx.dcx().span_delayed_bug(
293-
span,
294-
format!("failed region resolution while normalizing {elaborated_env:?}: {errors:?}"),
295-
);
296-
}
297-
291+
//
292+
// FIXME(-Zhigher-ranked-assumptions): We're ignoring region errors for now.
293+
// There're placeholder constraints `leaking` out. This is a hack to work around
294+
// the fact that we don't support placeholder assumptions right now and is necessary
295+
// for `compare_method_predicate_entailment`. We should remove this once we
296+
// have proper support for implied bounds on binders.
297+
let _errors = infcx.resolve_regions(cause.body_id, elaborated_env, []);
298298
match infcx.fully_resolve(predicates) {
299299
Ok(predicates) => Ok(predicates),
300300
Err(fixup_err) => {

0 commit comments

Comments
 (0)