Skip to content

Commit

Permalink
Support both current and prior nightly rustc
Browse files Browse the repository at this point in the history
The type of `testfn` used to be `Box<FnOnce<(), Output = ()>>` but is
now `FnBox<(), Output = ()>`. Wrap in a new closure to paper over the
difference in such a way that is both forwards and backwards
compatible.
  • Loading branch information
estebank committed May 29, 2019
1 parent a751b89 commit b85523a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ fn render_data_test(desc: &DataTestDesc, rendered: &mut Vec<TestDescAndFn>) {
};

let testfn = match case.testfn {
DataTestFn::TestFn(testfn) => TestFn::DynTestFn(testfn),
DataTestFn::TestFn(testfn) => TestFn::DynTestFn(Box::new(|| testfn())),
DataTestFn::BenchFn(benchfn) => TestFn::DynBenchFn(benchfn),
};

Expand Down

0 comments on commit b85523a

Please sign in to comment.