Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
review comments
  • Loading branch information
estebank committed Nov 14, 2019
commit c0a0a7d711b89d89e04a135d6035a2881a7de72e
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/generator_interior.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ impl<'a, 'tcx> Visitor<'tcx> for InteriorVisitor<'a, 'tcx> {
// 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);
Expand Down
2 changes: 2 additions & 0 deletions src/test/ui/async-await/issue-66387-if-without-else.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}