rust/src/test/run-fail/unwind-resource-fail.rs

29 lines
689 B
Rust
Raw Normal View History

// Copyright 2012 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.
#![feature(managed_boxes)]
2013-10-23 04:49:18 -04:00
2012-11-15 19:50:53 -08:00
// error-pattern:squirrel
2012-11-15 19:50:53 -08:00
struct r {
i: int,
}
impl Drop for r {
fn drop(&mut self) { fail!("squirrel") }
}
2012-11-15 19:50:53 -08:00
fn r(i: int) -> r { r { i: i } }
fn main() {
@0;
2013-08-17 08:37:42 -07:00
let _r = r(0);
}