Skip to content

Commit b24a30e

Browse files
committed
Remove unnecessary closure in rustc_mir/build/mod.rs
1 parent 63d6649 commit b24a30e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/librustc_mir/build/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ use util as mir_util;
3737
/// Construct the MIR for a given def-id.
3838
pub fn mir_build<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Mir<'tcx> {
3939
let id = tcx.hir.as_local_node_id(def_id).unwrap();
40-
let unsupported = || {
41-
span_bug!(tcx.hir.span(id), "can't build MIR for {:?}", def_id);
42-
};
4340

4441
// Figure out what primary body this item has.
4542
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
5047

5148
_ => match tcx.hir.maybe_body_owned_by(id) {
5249
Some(body) => body,
53-
None => unsupported(),
50+
None => span_bug!(tcx.hir.span(id), "can't build MIR for {:?}", def_id),
5451
},
5552
};
5653

0 commit comments

Comments
 (0)