Skip to content

Commit a49b746

Browse files
committed
cyclesss
1 parent 2ac171f commit a49b746

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

compiler/rustc_typeck/src/astconv/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2279,7 +2279,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
22792279
}
22802280
hir::TyKind::Typeof(ref e) => {
22812281
tcx.sess.emit_err(TypeofReservedKeywordUsed { span: ast_ty.span });
2282-
tcx.type_of(e.hir_id.owner)
2282+
tcx.type_of(tcx.hir().local_def_id(e.hir_id))
22832283
}
22842284
hir::TyKind::Infer => {
22852285
// Infer also appears as the type of arguments or return

compiler/rustc_typeck/src/collect/type_of.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,8 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
422422
{
423423
tcx.types.usize
424424
}
425-
Node::Ty(&Ty { kind: TyKind::Typeof(ref constant), .. })
426-
if constant.hir_id == hir_id =>
427-
{
428-
tcx.typeck(def_id).node_type(constant.hir_id)
425+
Node::Ty(&Ty { kind: TyKind::Typeof(ref e), .. }) if e.hir_id == hir_id => {
426+
tcx.typeck(def_id).node_type(e.hir_id)
429427
}
430428

431429
Node::Expr(&Expr { kind: ExprKind::ConstBlock(ref anon_const), .. })

0 commit comments

Comments
 (0)