From 81e4d5f96c3065bab1f1590f6c9eb9045924ec0a Mon Sep 17 00:00:00 2001 From: Jane Lusby Date: Fri, 23 Apr 2021 13:28:17 -0700 Subject: [PATCH] add special case for typeof fallback --- compiler/rustc_typeck/src/check/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/rustc_typeck/src/check/mod.rs b/compiler/rustc_typeck/src/check/mod.rs index 80e173de6b6e..cb4257e05347 100644 --- a/compiler/rustc_typeck/src/check/mod.rs +++ b/compiler/rustc_typeck/src/check/mod.rs @@ -540,6 +540,12 @@ fn typeck_with_fallback<'tcx>( kind: TypeVariableOriginKind::TypeInference, span, }), + Node::Ty(&hir::Ty { + kind: hir::TyKind::Typeof(ref anon_const), .. + }) if anon_const.hir_id == id => fcx.next_ty_var(TypeVariableOrigin { + kind: TypeVariableOriginKind::TypeInference, + span, + }), Node::Expr(&hir::Expr { kind: hir::ExprKind::InlineAsm(ia), .. }) if ia.operands.iter().any(|(op, _op_sp)| match op { hir::InlineAsmOperand::Const { anon_const } => {