From ffaf2a5c270f6677d7746f6ae30f498692afc750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Sun, 5 Feb 2023 12:32:27 +0000 Subject: [PATCH] review comments --- compiler/rustc_hir_analysis/src/collect/type_of.rs | 2 +- compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_hir_analysis/src/collect/type_of.rs b/compiler/rustc_hir_analysis/src/collect/type_of.rs index e80ff89623a3..c5522c94874d 100644 --- a/compiler/rustc_hir_analysis/src/collect/type_of.rs +++ b/compiler/rustc_hir_analysis/src/collect/type_of.rs @@ -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 | ty::ReError => tcx.lifetimes.re_static, + ty::ReErased => tcx.lifetimes.re_static, _ => r, }) } diff --git a/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs b/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs index c79ef9802825..bc1d9dc3fde7 100644 --- a/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs +++ b/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs @@ -211,11 +211,13 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> { ); } - ReStatic | ReError => { + ReStatic => { // nothing lives longer than `'static` Ok(self.tcx().lifetimes.re_static) } + ReError => Ok(self.tcx().lifetimes.re_error), + ReEarlyBound(_) | ReFree(_) => { // All empty regions are less than early-bound, free, // and scope regions.