fix: skip implied bounds if unconstrained lifetime exists
This commit is contained in:
parent
a29dada983
commit
ecf2a9b75e
3 changed files with 46 additions and 1 deletions
|
@ -55,7 +55,16 @@ impl<'a, 'tcx: 'a> InferCtxtExt<'a, 'tcx> for InferCtxt<'tcx> {
|
|||
) -> Vec<OutlivesBound<'tcx>> {
|
||||
let ty = self.resolve_vars_if_possible(ty);
|
||||
let ty = OpportunisticRegionResolver::new(self).fold_ty(ty);
|
||||
assert!(!ty.needs_infer());
|
||||
|
||||
// We must avoid processing constrained lifetime variables in implied
|
||||
// bounds. See #110161 for context.
|
||||
if ty.needs_infer() {
|
||||
self.tcx.sess.delay_span_bug(
|
||||
self.tcx.source_span_untracked(body_id),
|
||||
"skipped implied_outlives_bounds due to unconstrained lifetimes",
|
||||
);
|
||||
return vec![];
|
||||
}
|
||||
|
||||
let span = self.tcx.def_span(body_id);
|
||||
let result = param_env
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue