Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/libcore/finally.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
17 changes: 11 additions & 6 deletions src/test/run-pass/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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) {
Expand Down