Skip to content

Commit 81e4d5f

Browse files
committed
add special case for typeof fallback
1 parent a49b746 commit 81e4d5f

File tree

1 file changed

+6
-0
lines changed
  • compiler/rustc_typeck/src/check

1 file changed

+6
-0
lines changed

compiler/rustc_typeck/src/check/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,12 @@ fn typeck_with_fallback<'tcx>(
540540
kind: TypeVariableOriginKind::TypeInference,
541541
span,
542542
}),
543+
Node::Ty(&hir::Ty {
544+
kind: hir::TyKind::Typeof(ref anon_const), ..
545+
}) if anon_const.hir_id == id => fcx.next_ty_var(TypeVariableOrigin {
546+
kind: TypeVariableOriginKind::TypeInference,
547+
span,
548+
}),
543549
Node::Expr(&hir::Expr { kind: hir::ExprKind::InlineAsm(ia), .. })
544550
if ia.operands.iter().any(|(op, _op_sp)| match op {
545551
hir::InlineAsmOperand::Const { anon_const } => {

0 commit comments

Comments
 (0)