Skip to content

Commit ffaf2a5

Browse files
committed
review comments
1 parent 30cf7a3 commit ffaf2a5

File tree

2 files changed

+4
-2
lines changed
  • compiler
    • rustc_hir_analysis/src/collect
    • rustc_infer/src/infer/lexical_region_resolve

2 files changed

+4
-2
lines changed

compiler/rustc_hir_analysis/src/collect/type_of.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ fn infer_placeholder_type<'a>(
928928

929929
// Typeck doesn't expect erased regions to be returned from `type_of`.
930930
tcx.fold_regions(ty, |r, _| match *r {
931-
ty::ReErased | ty::ReError => tcx.lifetimes.re_static,
931+
ty::ReErased => tcx.lifetimes.re_static,
932932
_ => r,
933933
})
934934
}

compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,13 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
211211
);
212212
}
213213

214-
ReStatic | ReError => {
214+
ReStatic => {
215215
// nothing lives longer than `'static`
216216
Ok(self.tcx().lifetimes.re_static)
217217
}
218218

219+
ReError => Ok(self.tcx().lifetimes.re_error),
220+
219221
ReEarlyBound(_) | ReFree(_) => {
220222
// All empty regions are less than early-bound, free,
221223
// and scope regions.

0 commit comments

Comments
 (0)