parent
c40919b7a7
commit
30cf7a3f51
51 changed files with 208 additions and 211 deletions
|
@ -264,10 +264,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
|||
// 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");
|
||||
|
||||
// Supply some dummy value. We don't have an
|
||||
// `re_error`, annoyingly, so use `'static`.
|
||||
tcx.lifetimes.re_static
|
||||
tcx.lifetimes.re_error
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -482,10 +479,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
|||
|
||||
// This indicates an illegal lifetime in a non-assoc-trait position
|
||||
tcx.sess.delay_span_bug(self.span, "unelided lifetime in signature");
|
||||
|
||||
// Supply some dummy value. We don't have an
|
||||
// `re_error`, annoyingly, so use `'static`.
|
||||
tcx.lifetimes.re_static
|
||||
tcx.lifetimes.re_error
|
||||
})
|
||||
.into(),
|
||||
GenericParamDefKind::Type { has_default, .. } => {
|
||||
|
@ -1629,7 +1623,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
|||
} else {
|
||||
err.emit();
|
||||
}
|
||||
tcx.lifetimes.re_static
|
||||
tcx.lifetimes.re_error
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
|
@ -792,7 +792,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
|
|||
return_span,
|
||||
"expected ReFree to map to ReEarlyBound"
|
||||
);
|
||||
return tcx.lifetimes.re_static;
|
||||
return tcx.lifetimes.re_error;
|
||||
};
|
||||
tcx.mk_region(ty::ReEarlyBound(ty::EarlyBoundRegion {
|
||||
def_id: e.def_id,
|
||||
|
|
|
@ -928,7 +928,7 @@ fn infer_placeholder_type<'a>(
|
|||
|
||||
// Typeck doesn't expect erased regions to be returned from `type_of`.
|
||||
tcx.fold_regions(ty, |r, _| match *r {
|
||||
ty::ReErased => tcx.lifetimes.re_static,
|
||||
ty::ReErased | ty::ReError => tcx.lifetimes.re_static,
|
||||
_ => r,
|
||||
})
|
||||
}
|
||||
|
|
|
@ -170,6 +170,8 @@ 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,
|
||||
|
||||
// These regions don't appear in types from type declarations:
|
||||
ty::ReErased | ty::ReVar(..) | ty::RePlaceholder(..) | ty::ReFree(..) => {
|
||||
bug!("unexpected region in outlives inference: {:?}", region);
|
||||
|
|
|
@ -409,6 +409,8 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
|
|||
// way early-bound regions do, so we skip them here.
|
||||
}
|
||||
|
||||
ty::ReError => {}
|
||||
|
||||
ty::ReFree(..) | ty::ReVar(..) | ty::RePlaceholder(..) | ty::ReErased => {
|
||||
// We don't expect to see anything but 'static or bound
|
||||
// regions when visiting member types or method types.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue