Don't emit landing pads with -Z no-landing-pads

Closes #11647
This commit is contained in:
Alex Crichton 2014-01-18 11:21:10 -08:00
parent f3f2e697d8
commit caa321ab7d
2 changed files with 33 additions and 1 deletions

View file

@ -940,7 +940,7 @@ pub fn invoke<'a>(
}
}
if bcx.fcx.needs_invoke() {
if need_invoke(bcx) {
unsafe {
debug!("invoking {} at {}", llfn, bcx.llbb);
for &llarg in llargs.iter() {

View file

@ -0,0 +1,32 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z no-landing-pads
// xfail-fast
use std::task;
static mut HIT: bool = false;
struct A;
impl Drop for A {
fn drop(&mut self) {
unsafe { HIT = true; }
}
}
fn main() {
do task::try::<()> {
let _a = A;
fail!();
};
assert!(unsafe { !HIT });
}