Skip to content

Commit 89d5a7c

Browse files
committed
---
yaml --- r: 273303 b: refs/heads/beta c: 50fda1e h: refs/heads/master i: 273301: da34279 273299: d98a776 273295: 8d3ac82
1 parent bc32aad commit 89d5a7c

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 157e1bc6811b033bf640b68ffdf3ea0f1b804ccf
26+
refs/heads/beta: 50fda1eead10af900a7b7c9f07983937e66bcc3c
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/test/run-pass/panic-handler-chain.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ static A: AtomicUsize = AtomicUsize::new(0);
1717
static B: AtomicUsize = AtomicUsize::new(0);
1818

1919
fn main() {
20-
panic::set_handler(|_| { A.fetch_add(1, Ordering::SeqCst); });
21-
let handler = panic::take_handler();
22-
panic::set_handler(move |info| {
20+
panic::set_hook(Box::new(|_| { A.fetch_add(1, Ordering::SeqCst); }));
21+
let hook = panic::take_hook();
22+
panic::set_hook(Box::new(move |info| {
2323
B.fetch_add(1, Ordering::SeqCst);
24-
handler(info);
25-
});
24+
hook(info);
25+
}));
2626

2727
let _ = thread::spawn(|| {
2828
panic!();

branches/beta/src/test/run-pass/panic-handler-flail-wildly.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,28 @@ use std::panic;
1515
use std::thread;
1616

1717
fn a() {
18-
panic::set_handler(|_| println!("hello yes this is a"));
19-
panic::take_handler();
20-
panic::set_handler(|_| println!("hello yes this is a part 2"));
21-
panic::take_handler();
18+
panic::set_hook(Box::new(|_| println!("hello yes this is a")));
19+
panic::take_hook();
20+
panic::set_hook(Box::new(|_| println!("hello yes this is a part 2")));
21+
panic::take_hook();
2222
}
2323

2424
fn b() {
25-
panic::take_handler();
26-
panic::take_handler();
27-
panic::take_handler();
28-
panic::take_handler();
29-
panic::take_handler();
25+
panic::take_hook();
26+
panic::take_hook();
27+
panic::take_hook();
28+
panic::take_hook();
29+
panic::take_hook();
3030
panic!();
3131
}
3232

3333
fn c() {
34-
panic::set_handler(|_| ());
35-
panic::set_handler(|_| ());
36-
panic::set_handler(|_| ());
37-
panic::set_handler(|_| ());
38-
panic::set_handler(|_| ());
39-
panic::set_handler(|_| ());
34+
panic::set_hook(Box::new(|_| ()));
35+
panic::set_hook(Box::new(|_| ()));
36+
panic::set_hook(Box::new(|_| ()));
37+
panic::set_hook(Box::new(|_| ()));
38+
panic::set_hook(Box::new(|_| ()));
39+
panic::set_hook(Box::new(|_| ()));
4040
panic!();
4141
}
4242

branches/beta/src/test/run-pass/panic-handler-set-twice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use std::thread;
1818
static A: AtomicUsize = AtomicUsize::new(0);
1919

2020
fn main() {
21-
panic::set_handler(|_| ());
22-
panic::set_handler(|info| { A.fetch_add(1, Ordering::SeqCst); });
21+
panic::set_hook(Box::new(|_| ()));
22+
panic::set_hook(Box::new(|info| { A.fetch_add(1, Ordering::SeqCst); }));
2323

2424
let _ = thread::spawn(|| {
2525
panic!();

0 commit comments

Comments
 (0)