diff --git a/src/work.rs b/src/work.rs index ee0ac21..f5f80b6 100644 --- a/src/work.rs +++ b/src/work.rs @@ -149,7 +149,9 @@ where I: IntoIterator, let task = progress.add_task(format!("{:?}", filename.as_ref())); future::join(task, worker).await } else { - (Option::::None, do_work(process.as_ref(), &filename, ()).await) + #[cfg(nightly)] type NoReturn = !; + #[cfg(not(nightly))] type NoReturn = (); + (Option::::None, do_work(process.as_ref(), &filename, ()).await) } } }; @@ -165,7 +167,13 @@ where I: IntoIterator, if #[cfg(feature="progress")] { worker.0.ok().into() } else { - std::marker::PhantomData:: + cfg_if!{ + if #[cfg(nightly)] { + std::marker::PhantomData:: + } else { + std::marker::PhantomData::<()> + } + } } } };