diff --git a/src/cargo/core/compiler/job.rs b/src/cargo/core/compiler/job.rs index 000440d2e..7d589ee79 100644 --- a/src/cargo/core/compiler/job.rs +++ b/src/cargo/core/compiler/job.rs @@ -12,17 +12,7 @@ pub struct Job { /// Each proc should send its description before starting. /// It should send either once or close immediately. pub struct Work { - inner: Box FnBox<&'a JobState<'b>, CargoResult<()>> + Send>, -} - -trait FnBox { - fn call_box(self: Box, a: A) -> R; -} - -impl R> FnBox for F { - fn call_box(self: Box, a: A) -> R { - (*self)(a) - } + inner: Box) -> CargoResult<()> + Send>, } impl Work { @@ -38,7 +28,7 @@ impl Work { } pub fn call(self, tx: &JobState<'_>) -> CargoResult<()> { - self.inner.call_box(tx) + (self.inner)(tx) } pub fn then(self, next: Work) -> Work {