Skip to content
This repository has been archived by the owner on Aug 12, 2021. It is now read-only.

Replace FnBox with Box<dyn FnOnce> #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 2 additions & 4 deletions libtest/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! Rust's built-in unit-test and micro-benchmarking framework.
#![cfg_attr(any(unix, target_os = "cloudabi", target_os = "fuchsia"), feature(libc, rustc_private))]
#![feature(fnbox)]
#![feature(set_stdio)]
#![feature(panic_unwind)]
#![feature(termination_trait_lib)]
Expand Down Expand Up @@ -32,7 +31,6 @@ extern crate panic_unwind;
use std::{
any::Any,
borrow::Cow,
boxed::FnBox,
cmp,
collections::BTreeMap,
env, fmt,
Expand Down Expand Up @@ -142,7 +140,7 @@ pub trait TDynBenchFn: Send {
pub enum TestFn {
StaticTestFn(fn()),
StaticBenchFn(fn(&mut Bencher)),
DynTestFn(Box<dyn FnBox() + Send>),
DynTestFn(Box<dyn FnOnce() + Send>),
DynBenchFn(Box<dyn TDynBenchFn + 'static>),
}

Expand Down Expand Up @@ -1471,7 +1469,7 @@ pub fn run_test(
desc: TestDesc,
monitor_ch: Sender<MonitorMsg>,
nocapture: bool,
testfn: Box<dyn FnBox() + Send>,
testfn: Box<dyn FnOnce() + Send>,
concurrency: Concurrent,
) {
// Buffer for capturing standard I/O
Expand Down