未验证 提交 b24a30e9 编写于 作者: I Isaac Woods

Remove unnecessary closure in rustc_mir/build/mod.rs

上级 63d66494
......@@ -37,9 +37,6 @@
/// Construct the MIR for a given def-id.
pub fn mir_build<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Mir<'tcx> {
let id = tcx.hir.as_local_node_id(def_id).unwrap();
let unsupported = || {
span_bug!(tcx.hir.span(id), "can't build MIR for {:?}", def_id);
};
// Figure out what primary body this item has.
let body_id = match tcx.hir.get(id) {
......@@ -50,7 +47,7 @@ pub fn mir_build<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Mir<'t
_ => match tcx.hir.maybe_body_owned_by(id) {
Some(body) => body,
None => unsupported(),
None => span_bug!(tcx.hir.span(id), "can't build MIR for {:?}", def_id),
},
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册