1
Fork 0

ignore implied bounds with placeholders

This commit is contained in:
Ali MJ Al-Nasrawy 2023-06-08 10:43:58 +00:00
parent 492e57c6ad
commit af79fd109b
4 changed files with 81 additions and 3 deletions

View file

@ -72,7 +72,7 @@ impl<'a, 'tcx: 'a> InferCtxtExt<'a, 'tcx> for InferCtxt<'tcx> {
};
let mut constraints = QueryRegionConstraints::default();
let Ok(InferOk { value, obligations }) = self
let Ok(InferOk { value: mut bounds, obligations }) = self
.instantiate_nll_query_response_and_region_obligations(
&ObligationCause::dummy(),
param_env,
@ -85,6 +85,10 @@ impl<'a, 'tcx: 'a> InferCtxtExt<'a, 'tcx> for InferCtxt<'tcx> {
};
assert_eq!(&obligations, &[]);
// Because of #109628, we may have unexpected placeholders. Ignore them!
// FIXME(#109628): panic in this case once the issue is fixed.
bounds.retain(|bound| !bound.has_placeholders());
if !constraints.is_empty() {
let span = self.tcx.def_span(body_id);
@ -114,7 +118,7 @@ impl<'a, 'tcx: 'a> InferCtxtExt<'a, 'tcx> for InferCtxt<'tcx> {
}
};
value
bounds
}
fn implied_bounds_tys(