1
Fork 0

Change to ReError(ErrorGuaranteed)

This commit is contained in:
Esteban Küber 2023-02-07 14:55:16 +00:00
parent ffaf2a5c27
commit 861f451235
23 changed files with 70 additions and 61 deletions

View file

@ -263,8 +263,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
// elision. `resolve_lifetime` should have
// reported an error in this case -- but if
// not, let's error out.
tcx.sess.delay_span_bug(lifetime.ident.span, "unelided lifetime in signature");
tcx.lifetimes.re_error
tcx.re_error_with_message(lifetime.ident.span, "unelided lifetime in signature")
})
}
}
@ -478,8 +477,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
debug!(?param, "unelided lifetime in signature");
// This indicates an illegal lifetime in a non-assoc-trait position
tcx.sess.delay_span_bug(self.span, "unelided lifetime in signature");
tcx.lifetimes.re_error
tcx.re_error_with_message(self.span, "unelided lifetime in signature")
})
.into(),
GenericParamDefKind::Type { has_default, .. } => {
@ -1623,7 +1621,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
} else {
err.emit();
}
tcx.lifetimes.re_error
tcx.re_error()
})
}
})

View file

@ -786,13 +786,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
}
let Some(ty::ReEarlyBound(e)) = map.get(&region.into()).map(|r| r.expect_region().kind())
else {
tcx
.sess
.delay_span_bug(
return_span,
"expected ReFree to map to ReEarlyBound"
);
return tcx.lifetimes.re_error;
return tcx.re_error_with_message(return_span, "expected ReFree to map to ReEarlyBound")
};
tcx.mk_region(ty::ReEarlyBound(ty::EarlyBoundRegion {
def_id: e.def_id,

View file

@ -170,7 +170,7 @@ fn is_free_region(region: Region<'_>) -> bool {
// ignore it. We can't put it on the struct header anyway.
ty::ReLateBound(..) => false,
ty::ReError => false,
ty::ReError(_) => false,
// These regions don't appear in types from type declarations:
ty::ReErased | ty::ReVar(..) | ty::RePlaceholder(..) | ty::ReFree(..) => {

View file

@ -409,7 +409,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
// way early-bound regions do, so we skip them here.
}
ty::ReError => {}
ty::ReError(_) => {}
ty::ReFree(..) | ty::ReVar(..) | ty::RePlaceholder(..) | ty::ReErased => {
// We don't expect to see anything but 'static or bound