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.
from_anon_const
AnonConst
1 parent 9bcd9fe commit 124ab20Copy full SHA for 124ab20
src/librustc/ty/sty.rs
@@ -2409,7 +2409,10 @@ impl<'tcx> Const<'tcx> {
2409
2410
let hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
2411
2412
- let body_id = tcx.hir().body_owned_by(hir_id);
+ let body_id = match tcx.hir().get(hir_id) {
2413
+ hir::Node::AnonConst(ac) => ac.body,
2414
+ _ => span_bug!(tcx.def_span(def_id.to_def_id()), "from_anon_const can only process anonymous constants"),
2415
+ };
2416
2417
let expr = &tcx.hir().body(body_id).value;
2418
0 commit comments