diff options
| author | Jane Lusby <jlusby@yaah.dev> | 2021-04-23 13:28:17 -0700 |
|---|---|---|
| committer | Jane Lusby <jlusby@yaah.dev> | 2021-04-23 13:28:17 -0700 |
| commit | 81e4d5f96c3065bab1f1590f6c9eb9045924ec0a (patch) | |
| tree | b25b2f38e4cf1b2aff6d8e9ed2be55f56aed351d | |
| parent | a49b746da43625fd789c2cd72d24093525c4ca17 (diff) | |
| download | rust-81e4d5f96c3065bab1f1590f6c9eb9045924ec0a.tar.gz rust-81e4d5f96c3065bab1f1590f6c9eb9045924ec0a.zip | |
add special case for typeof fallback
| -rw-r--r-- | compiler/rustc_typeck/src/check/mod.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_typeck/src/check/mod.rs b/compiler/rustc_typeck/src/check/mod.rs index 80e173de6b6..cb4257e0534 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 } => { |
