From b24a30e94d19b3ac537665e9b9856f7caabc895f Mon Sep 17 00:00:00 2001 From: Isaac Woods Date: Fri, 24 Aug 2018 11:20:30 +0100 Subject: [PATCH] Remove unnecessary closure in rustc_mir/build/mod.rs --- src/librustc_mir/build/mod.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/librustc_mir/build/mod.rs b/src/librustc_mir/build/mod.rs index 179bc2426ab4a..dc88446319cf3 100644 --- a/src/librustc_mir/build/mod.rs +++ b/src/librustc_mir/build/mod.rs @@ -37,9 +37,6 @@ use util as mir_util; /// 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), }, };