diff options
| author | Brian Anderson <banderson@mozilla.com> | 2016-09-14 17:15:48 +0000 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2016-09-30 14:02:53 -0700 |
| commit | a4c328812997540c82f5039d346d0b30bc1feac4 (patch) | |
| tree | 69427c145feba36c3cc4d5fab672fac300931a81 /src/libtest | |
| parent | 183b2ddce4771df3bcfe36eb229a1791fe4b0f8f (diff) | |
| download | rust-a4c328812997540c82f5039d346d0b30bc1feac4.tar.gz rust-a4c328812997540c82f5039d346d0b30bc1feac4.zip | |
Change the sigs of set_print/set_panic to allow restoring the default objects
Diffstat (limited to 'src/libtest')
| -rw-r--r-- | src/libtest/lib.rs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 49a7f6589d2..5949afe0ff1 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -1200,8 +1200,8 @@ pub fn run_test(opts: &TestOpts, let result_guard = cfg.spawn(move || { if !nocapture { - io::set_print(box Sink(data2.clone())); - io::set_panic(box Sink(data2)); + io::set_print(Some(box Sink(data2.clone()))); + io::set_panic(Some(box Sink(data2))); } testfn() }) @@ -1213,8 +1213,8 @@ pub fn run_test(opts: &TestOpts, } else { let oldio = if !nocapture { Some(( - io::set_print(box Sink(data2.clone())), - io::set_panic(box Sink(data2)) + io::set_print(Some(box Sink(data2.clone()))), + io::set_panic(Some(box Sink(data2))) )) } else { None @@ -1227,12 +1227,8 @@ pub fn run_test(opts: &TestOpts, })); if let Some((printio, panicio)) = oldio { - if let Some(printio) = printio { - io::set_print(printio); - } - if let Some(panicio) = panicio { - io::set_panic(panicio); - } + io::set_print(printio); + io::set_panic(panicio); }; let test_result = calc_result(&desc, result); |
