Skip to content

Commit fdeb7f2

Browse files
committed
Add comments.
1 parent cef3773 commit fdeb7f2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

compiler/rustc_typeck/src/astconv/mod.rs

+5
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
205205
def: Option<&ty::GenericParamDef>,
206206
) -> ty::Region<'tcx> {
207207
let tcx = self.tcx();
208+
if let hir::LifetimeName::ImplicitObjectLifetimeDefault = lifetime.name {
209+
panic!(
210+
"ImplicitObjectLifetimeDefault should be handled separately from ast_region_to_region."
211+
);
212+
}
208213

209214
let r = if let Some(rl) = tcx.named_region(lifetime.hir_id) {
210215
self.ast_region_to_region_inner(rl)

compiler/rustc_typeck/src/collect.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1349,6 +1349,9 @@ fn has_late_bound_regions<'tcx>(tcx: TyCtxt<'tcx>, node: Node<'tcx>) -> Option<S
13491349
return;
13501350
}
13511351
if let hir::LifetimeName::ImplicitObjectLifetimeDefault = lt.name {
1352+
// The lifetime this resolves must already have been encountered
1353+
// by the visitor, or be `'static`. In both cases, we have nothing
1354+
// to do.
13521355
return;
13531356
}
13541357

0 commit comments

Comments
 (0)