about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-01-14 12:19:58 +0000
committerbors <bors@rust-lang.org>2015-01-14 12:19:58 +0000
commit896cb36ecab3eaeb7f101087e030e43771eca5ca (patch)
tree83a6ae18e2ee32737a7c0fbbaca83dd0d6685ffa /src
parentd52398ef8cd93c6089ceacb176ae0dbe213d301e (diff)
parentf0fe4bb11404b2834bc3160683c220861142f955 (diff)
downloadrust-896cb36ecab3eaeb7f101087e030e43771eca5ca.tar.gz
rust-896cb36ecab3eaeb7f101087e030e43771eca5ca.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/libcore/finally.rs6
-rw-r--r--src/test/run-pass/backtrace.rs17
2 files changed, 16 insertions, 7 deletions
diff --git a/src/libcore/finally.rs b/src/libcore/finally.rs
index a21ec892dd7..4c2a2ff1086 100644
--- a/src/libcore/finally.rs
+++ b/src/libcore/finally.rs
@@ -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};
 
diff --git a/src/test/run-pass/backtrace.rs b/src/test/run-pass/backtrace.rs
index da5fa19f816..320ad0bf4d1 100644
--- a/src/test/run-pass/backtrace.rs
+++ b/src/test/run-pass/backtrace.rs
@@ -12,11 +12,12 @@
 // ignore-windows FIXME #13259
 
 #![feature(unboxed_closures)]
+#![feature(unsafe_destructor)]
 
 use std::os;
 use std::io::process::Command;
-use std::finally::Finally;
 use std::str;
+use std::ops::{Drop, FnMut, FnOnce};
 
 #[inline(never)]
 fn foo() {
@@ -28,11 +29,15 @@ fn foo() {
 
 #[inline(never)]
 fn double() {
-    (|&mut:| {
-        panic!("once");
-    }).finally(|| {
-        panic!("twice");
-    })
+    struct Double;
+
+    impl Drop for Double {
+        fn drop(&mut self) { panic!("twice") }
+    }
+
+    let _d = Double;
+
+    panic!("once");
 }
 
 fn runtest(me: &str) {