Small improvements in object lifetime default code

I found those while trying to understand how the code works.
This commit is contained in:
Nilstrieb 2023-11-12 11:59:01 +01:00
parent ed086d86b8
commit 8bcd221b4c
3 changed files with 4 additions and 10 deletions

View file

@ -2845,6 +2845,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
/// provided, if they provided one, and otherwise search the supertypes of trait bounds
/// for region bounds. It may be that we can derive no bound at all, in which case
/// we return `None`.
#[instrument(level = "debug", skip(self, span), ret)]
fn compute_object_lifetime_bound(
&self,
span: Span,
@ -2853,8 +2854,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
{
let tcx = self.tcx();
debug!("compute_opt_region_bound(existential_predicates={:?})", existential_predicates);
// No explicit region bound specified. Therefore, examine trait
// bounds and see if we can derive region bounds from those.
let derived_region_bounds = object_region_bounds(tcx, existential_predicates);

View file

@ -1848,8 +1848,8 @@ impl<'a, 'tcx> BoundVarContext<'a, 'tcx> {
}
}
#[instrument(level = "debug", skip(self))]
fn resolve_object_lifetime_default(&mut self, lifetime_ref: &'tcx hir::Lifetime) {
debug!("resolve_object_lifetime_default(lifetime_ref={:?})", lifetime_ref);
let mut late_depth = 0;
let mut scope = self.scope;
let lifetime = loop {