This commit is contained in:
lcnr 2022-01-03 11:59:01 +01:00
parent 484dc1f7a2
commit a02bf76c96

View File

@ -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))
}