From c0a0a7d711b89d89e04a135d6035a2881a7de72e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Thu, 14 Nov 2019 11:08:56 -0800 Subject: [PATCH] review comments --- src/librustc_typeck/check/generator_interior.rs | 2 +- src/test/ui/async-await/issue-66387-if-without-else.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/librustc_typeck/check/generator_interior.rs b/src/librustc_typeck/check/generator_interior.rs index 6e254122c01..6e37c0dbbdf 100644 --- a/src/librustc_typeck/check/generator_interior.rs +++ b/src/librustc_typeck/check/generator_interior.rs @@ -245,7 +245,7 @@ fn visit_expr(&mut self, expr: &'tcx Expr) { // If this were not the case, then we could conceivably have // to create intermediate temporaries.) // - // The type table might not have invormation for this expression + // The type table might not have information for this expression // if it is in a malformed scope. (#66387) if let Some(ty) = self.fcx.tables.borrow().expr_ty_opt(expr) { self.record(ty, scope, Some(expr), expr.span); diff --git a/src/test/ui/async-await/issue-66387-if-without-else.rs b/src/test/ui/async-await/issue-66387-if-without-else.rs index 3602b09c0ec..aa5a8db6121 100644 --- a/src/test/ui/async-await/issue-66387-if-without-else.rs +++ b/src/test/ui/async-await/issue-66387-if-without-else.rs @@ -3,6 +3,8 @@ async fn f() -> i32 { if true { //~ ERROR if may be missing an else clause return 0; } + // An `if` block without `else` causes the type table not to have a type for this expr. + // Check that we do not unconditionally access the type table and we don't ICE. } fn main() {}