We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b3f8bb commit 23939e4Copy full SHA for 23939e4
compiler/rustc_middle/src/ty/consts.rs
@@ -40,17 +40,15 @@ impl<'tcx> Const<'tcx> {
40
41
let hir_id = tcx.hir().local_def_id_to_hir_id(def.did);
42
43
- let hir_ct = match tcx.hir().get(hir_id) {
44
- hir::Node::AnonConst(ac) => ac,
+ let body_id = match tcx.hir().get(hir_id) {
+ hir::Node::AnonConst(ac) => ac.body,
45
_ => span_bug!(
46
tcx.def_span(def.did.to_def_id()),
47
"from_anon_const can only process anonymous constants"
48
),
49
};
50
51
- warn!(?hir_ct.generics, ?hir_ct.generic_args);
52
-
53
- let expr = &tcx.hir().body(hir_ct.body).value;
+ let expr = &tcx.hir().body(body_id).value;
54
55
let ty = tcx.type_of(def.def_id_for_type_of());
56
0 commit comments