Skip to content

Commit

Permalink
Mir: fixup nits in previous commit (f536143)
Browse files Browse the repository at this point in the history
As suggested by arielb1.

Closes #18510

Signed-off-by: David Henningsson <diwic@ubuntu.com>
  • Loading branch information
diwic committed Dec 21, 2017
1 parent f536143 commit 4910ed2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/librustc_mir/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,10 @@ macro_rules! unpack {
};
}

fn needs_abort_block<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
fn_id: ast::NodeId,
abi: Abi)
-> bool {
fn should_abort_on_panic<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
fn_id: ast::NodeId,
abi: Abi)
-> bool {

// Not callable from C, so we can safely unwind through these
if abi == Abi::Rust || abi == Abi::RustCall { return false; }
Expand Down Expand Up @@ -405,8 +405,7 @@ fn construct_fn<'a, 'gcx, 'tcx, A>(hir: Cx<'a, 'gcx, 'tcx>,
let source_info = builder.source_info(span);
let call_site_s = (call_site_scope, source_info);
unpack!(block = builder.in_scope(call_site_s, LintLevel::Inherited, block, |builder| {

if needs_abort_block(tcx, fn_id, abi) {
if should_abort_on_panic(tcx, fn_id, abi) {
builder.schedule_abort();
}

Expand Down

0 comments on commit 4910ed2

Please sign in to comment.