Skip to content

Commit 23939e4

Browse files
committed
cleanup consts
1 parent 5b3f8bb commit 23939e4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

compiler/rustc_middle/src/ty/consts.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,15 @@ impl<'tcx> Const<'tcx> {
4040

4141
let hir_id = tcx.hir().local_def_id_to_hir_id(def.did);
4242

43-
let hir_ct = match tcx.hir().get(hir_id) {
44-
hir::Node::AnonConst(ac) => ac,
43+
let body_id = match tcx.hir().get(hir_id) {
44+
hir::Node::AnonConst(ac) => ac.body,
4545
_ => span_bug!(
4646
tcx.def_span(def.did.to_def_id()),
4747
"from_anon_const can only process anonymous constants"
4848
),
4949
};
5050

51-
warn!(?hir_ct.generics, ?hir_ct.generic_args);
52-
53-
let expr = &tcx.hir().body(hir_ct.body).value;
51+
let expr = &tcx.hir().body(body_id).value;
5452

5553
let ty = tcx.type_of(def.def_id_for_type_of());
5654

0 commit comments

Comments
 (0)