Skip to content

Commit 94236fc

Browse files
committed
auto merge of #11653 : alexcrichton/rust/issue-11647, r=luqmana
Closes #11647
2 parents b6400f9 + caa321a commit 94236fc

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

src/librustc/middle/trans/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ pub fn invoke<'a>(
940940
}
941941
}
942942

943-
if bcx.fcx.needs_invoke() {
943+
if need_invoke(bcx) {
944944
unsafe {
945945
debug!("invoking {} at {}", llfn, bcx.llbb);
946946
for &llarg in llargs.iter() {

src/test/run-pass/no-landing-pads.rs

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// compile-flags: -Z no-landing-pads
12+
// xfail-fast
13+
14+
use std::task;
15+
16+
static mut HIT: bool = false;
17+
18+
struct A;
19+
20+
impl Drop for A {
21+
fn drop(&mut self) {
22+
unsafe { HIT = true; }
23+
}
24+
}
25+
26+
fn main() {
27+
do task::try::<()> {
28+
let _a = A;
29+
fail!();
30+
};
31+
assert!(unsafe { !HIT });
32+
}

0 commit comments

Comments
 (0)