Change to ReError(ErrorGuaranteed)
This commit is contained in:
parent
ffaf2a5c27
commit
861f451235
23 changed files with 70 additions and 61 deletions
|
@ -31,7 +31,7 @@ impl<'a> DescriptionCtx<'a> {
|
|||
|
||||
ty::RePlaceholder(_) => return None,
|
||||
|
||||
ty::ReError => return None,
|
||||
ty::ReError(_) => return None,
|
||||
|
||||
// FIXME(#13998) RePlaceholder should probably print like
|
||||
// ReFree rather than dumping Debug output on the user.
|
||||
|
|
|
@ -371,7 +371,7 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for Canonicalizer<'cx, 'tcx> {
|
|||
|
||||
ty::ReStatic
|
||||
| ty::ReEarlyBound(..)
|
||||
| ty::ReError
|
||||
| ty::ReError(_)
|
||||
| ty::ReFree(_)
|
||||
| ty::RePlaceholder(..)
|
||||
| ty::ReErased => self.canonicalize_mode.canonicalize_free_region(self, r),
|
||||
|
|
|
@ -705,7 +705,7 @@ impl<'tcx> TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
|
|||
return Ok(r);
|
||||
}
|
||||
|
||||
ty::ReError => {
|
||||
ty::ReError(_) => {
|
||||
return Ok(r);
|
||||
}
|
||||
|
||||
|
@ -865,7 +865,7 @@ impl<'tcx> FallibleTypeFolder<'tcx> for ConstInferUnifier<'_, 'tcx> {
|
|||
match *r {
|
||||
// Never make variables for regions bound within the type itself,
|
||||
// nor for erased regions.
|
||||
ty::ReLateBound(..) | ty::ReErased | ty::ReError => {
|
||||
ty::ReLateBound(..) | ty::ReErased | ty::ReError(_) => {
|
||||
return Ok(r);
|
||||
}
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ pub(super) fn note_and_explain_region<'tcx>(
|
|||
|
||||
ty::RePlaceholder(_) => return,
|
||||
|
||||
ty::ReError => return,
|
||||
ty::ReError(_) => return,
|
||||
|
||||
// FIXME(#13998) RePlaceholder should probably print like
|
||||
// ReFree rather than dumping Debug output on the user.
|
||||
|
@ -315,7 +315,7 @@ pub fn unexpected_hidden_region_diagnostic<'tcx>(
|
|||
)
|
||||
}
|
||||
}
|
||||
ty::ReError => {
|
||||
ty::ReError(_) => {
|
||||
err.delay_as_bug();
|
||||
}
|
||||
_ => {
|
||||
|
|
|
@ -126,7 +126,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> {
|
|||
| ty::ReFree(_)
|
||||
| ty::ReVar(_)
|
||||
| ty::RePlaceholder(..)
|
||||
| ty::ReError
|
||||
| ty::ReError(_)
|
||||
| ty::ReErased => {
|
||||
// replace all free regions with 'erased
|
||||
self.tcx().lifetimes.re_erased
|
||||
|
|
|
@ -216,7 +216,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
|||
Ok(self.tcx().lifetimes.re_static)
|
||||
}
|
||||
|
||||
ReError => Ok(self.tcx().lifetimes.re_error),
|
||||
ReError(_) => Ok(self.tcx().re_error()),
|
||||
|
||||
ReEarlyBound(_) | ReFree(_) => {
|
||||
// All empty regions are less than early-bound, free,
|
||||
|
@ -438,7 +438,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
|||
}
|
||||
(VarValue::Value(a), VarValue::Empty(_)) => {
|
||||
match *a {
|
||||
ReLateBound(..) | ReErased | ReError => {
|
||||
ReLateBound(..) | ReErased | ReError(_) => {
|
||||
bug!("cannot relate region: {:?}", a);
|
||||
}
|
||||
|
||||
|
@ -467,7 +467,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
|||
}
|
||||
(VarValue::Empty(a_ui), VarValue::Value(b)) => {
|
||||
match *b {
|
||||
ReLateBound(..) | ReErased | ReError => {
|
||||
ReLateBound(..) | ReErased | ReError(_) => {
|
||||
bug!("cannot relate region: {:?}", b);
|
||||
}
|
||||
|
||||
|
@ -548,7 +548,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
|||
);
|
||||
}
|
||||
|
||||
(ReError, _) | (_, ReError) => self.tcx().lifetimes.re_error,
|
||||
(ReError(_), _) | (_, ReError(_)) => self.tcx().re_error(),
|
||||
|
||||
(ReStatic, _) | (_, ReStatic) => {
|
||||
// nothing lives longer than `'static`
|
||||
|
@ -1044,7 +1044,7 @@ impl<'tcx> LexicalRegionResolutions<'tcx> {
|
|||
ty::ReVar(rid) => match self.values[rid] {
|
||||
VarValue::Empty(_) => r,
|
||||
VarValue::Value(r) => r,
|
||||
VarValue::ErrorValue => tcx.lifetimes.re_error,
|
||||
VarValue::ErrorValue => tcx.re_error(),
|
||||
},
|
||||
_ => r,
|
||||
};
|
||||
|
|
|
@ -696,9 +696,11 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
|
|||
|
||||
pub fn universe(&self, region: Region<'tcx>) -> ty::UniverseIndex {
|
||||
match *region {
|
||||
ty::ReStatic | ty::ReErased | ty::ReFree(..) | ty::ReEarlyBound(..) | ty::ReError => {
|
||||
ty::UniverseIndex::ROOT
|
||||
}
|
||||
ty::ReStatic
|
||||
| ty::ReErased
|
||||
| ty::ReFree(..)
|
||||
| ty::ReEarlyBound(..)
|
||||
| ty::ReError(_) => ty::UniverseIndex::ROOT,
|
||||
ty::RePlaceholder(placeholder) => placeholder.universe,
|
||||
ty::ReVar(vid) => self.var_universe(vid),
|
||||
ty::ReLateBound(..) => bug!("universe(): encountered bound region {:?}", region),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue