From a49b746da43625fd789c2cd72d24093525c4ca17 Mon Sep 17 00:00:00 2001 From: Jane Lusby Date: Sat, 26 Sep 2020 17:26:12 -0700 Subject: [PATCH] cyclesss --- compiler/rustc_typeck/src/astconv/mod.rs | 2 +- compiler/rustc_typeck/src/collect/type_of.rs | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_typeck/src/astconv/mod.rs b/compiler/rustc_typeck/src/astconv/mod.rs index 34e06e2d5a01..6e7d7f33f728 100644 --- a/compiler/rustc_typeck/src/astconv/mod.rs +++ b/compiler/rustc_typeck/src/astconv/mod.rs @@ -2279,7 +2279,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { } hir::TyKind::Typeof(ref e) => { tcx.sess.emit_err(TypeofReservedKeywordUsed { span: ast_ty.span }); - tcx.type_of(e.hir_id.owner) + tcx.type_of(tcx.hir().local_def_id(e.hir_id)) } hir::TyKind::Infer => { // Infer also appears as the type of arguments or return diff --git a/compiler/rustc_typeck/src/collect/type_of.rs b/compiler/rustc_typeck/src/collect/type_of.rs index 74135c49d582..51d5f4ebe2bd 100644 --- a/compiler/rustc_typeck/src/collect/type_of.rs +++ b/compiler/rustc_typeck/src/collect/type_of.rs @@ -422,10 +422,8 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> { { tcx.types.usize } - Node::Ty(&Ty { kind: TyKind::Typeof(ref constant), .. }) - if constant.hir_id == hir_id => - { - tcx.typeck(def_id).node_type(constant.hir_id) + Node::Ty(&Ty { kind: TyKind::Typeof(ref e), .. }) if e.hir_id == hir_id => { + tcx.typeck(def_id).node_type(e.hir_id) } Node::Expr(&Expr { kind: ExprKind::ConstBlock(ref anon_const), .. })