auto merge of #21082 : brson/rust/finally, r=alexcrichton
No in-tree users. Ugly interface. Closes #14332. I just happened to notice that this module still lives and has no users. Assuming we don't want it. r? @aturon cc @alexcrichton
This commit is contained in:
commit
896cb36eca
@ -32,7 +32,11 @@
|
|||||||
//! # }
|
//! # }
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
#![unstable]
|
#![deprecated = "It is unclear if this module is more robust than implementing \
|
||||||
|
Drop on a custom type, and this module is being removed with no \
|
||||||
|
replacement. Use a custom Drop implementation to regain existing \
|
||||||
|
functionality."]
|
||||||
|
#![allow(deprecated)]
|
||||||
|
|
||||||
use ops::{Drop, FnMut, FnOnce};
|
use ops::{Drop, FnMut, FnOnce};
|
||||||
|
|
||||||
|
@ -12,11 +12,12 @@
|
|||||||
// ignore-windows FIXME #13259
|
// ignore-windows FIXME #13259
|
||||||
|
|
||||||
#![feature(unboxed_closures)]
|
#![feature(unboxed_closures)]
|
||||||
|
#![feature(unsafe_destructor)]
|
||||||
|
|
||||||
use std::os;
|
use std::os;
|
||||||
use std::io::process::Command;
|
use std::io::process::Command;
|
||||||
use std::finally::Finally;
|
|
||||||
use std::str;
|
use std::str;
|
||||||
|
use std::ops::{Drop, FnMut, FnOnce};
|
||||||
|
|
||||||
#[inline(never)]
|
#[inline(never)]
|
||||||
fn foo() {
|
fn foo() {
|
||||||
@ -28,11 +29,15 @@ fn foo() {
|
|||||||
|
|
||||||
#[inline(never)]
|
#[inline(never)]
|
||||||
fn double() {
|
fn double() {
|
||||||
(|&mut:| {
|
struct Double;
|
||||||
|
|
||||||
|
impl Drop for Double {
|
||||||
|
fn drop(&mut self) { panic!("twice") }
|
||||||
|
}
|
||||||
|
|
||||||
|
let _d = Double;
|
||||||
|
|
||||||
panic!("once");
|
panic!("once");
|
||||||
}).finally(|| {
|
|
||||||
panic!("twice");
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn runtest(me: &str) {
|
fn runtest(me: &str) {
|
||||||
|
Loading…
Reference in New Issue
Block a user