From a02bf76c9667ad7a25df3b672b3748398451a3d0 Mon Sep 17 00:00:00 2001 From: lcnr Date: Mon, 3 Jan 2022 11:59:01 +0100 Subject: [PATCH] review --- compiler/rustc_save_analysis/src/sig.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/compiler/rustc_save_analysis/src/sig.rs b/compiler/rustc_save_analysis/src/sig.rs index 5d0de444199..4971bb6d1aa 100644 --- a/compiler/rustc_save_analysis/src/sig.rs +++ b/compiler/rustc_save_analysis/src/sig.rs @@ -312,11 +312,7 @@ impl<'hir> Sig for hir::Ty<'hir> { } hir::TyKind::Array(ref ty, ref length) => { let nested_ty = ty.make(offset + 1, id, scx)?; - let hir_id = match length { - &hir::ArrayLen::Infer(hir_id, _) => hir_id, - hir::ArrayLen::Body(anon_const) => anon_const.hir_id, - }; - let expr = id_to_string(&scx.tcx.hir(), hir_id).replace('\n', " "); + let expr = id_to_string(&scx.tcx.hir(), length.hir_id()).replace('\n', " "); let text = format!("[{}; {}]", nested_ty.text, expr); Ok(replace_text(nested_ty, text)) }