mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-01 00:00:10 +02:00
v0.1.x lint fix, MSRV 1.28.0 updates (#1451)
* use dyn Trait syntax where appropriate recent rust nightly started warning that not using `dyn` was deprecated. This requires MSRV 1.27.0+. * rustfmt fallout from dyn additions * stop explicit allow of rust_2018_idioms * more dyn Trait syntax * drop tokio-macros from 0.1.x workspace Since tokio-macros specifies an edition=2018, we would otherwise require MSRV 1.31.0 to build/test it. And tokio-macros isn't used with tokio 0.1.x. * reactor: narrow tokio-io-pool dev dep to 0.1.4 Since 0.1.5-6 is now a edition=2018 crate, which has effective MSRV 1.31.0. * narrow tempfile dev-dep to avoid MSRV bump tempfile 3.1.0 pulls in rand 0.7.0 and is MSRV 1.32.0 * narrow flate2 dev-dep to avoid MSRV bump flate2 1.0.10-11 have MSRV 1.34.0. github refs: alexcrichton/flate2-rs#207 * fs: drop deprecated tempdir crate use in tests In particular because it pulls in old rand duplicates. Replace use with tempfile::tempdir() which has been available since tempfile 3.0.0. backport-of: #1312 * increase CI MSRV to 1.28.0
This commit is contained in:
committed by
Lucio Franco
parent
b4cb3226ab
commit
c9532e49d7
@@ -67,7 +67,7 @@ pub struct Builder {
|
||||
max_blocking: usize,
|
||||
|
||||
/// Generates the `Park` instances
|
||||
new_park: Box<Fn(&WorkerId) -> BoxPark>,
|
||||
new_park: Box<dyn Fn(&WorkerId) -> BoxPark>,
|
||||
}
|
||||
|
||||
impl Builder {
|
||||
@@ -223,7 +223,7 @@ impl Builder {
|
||||
/// ```
|
||||
pub fn panic_handler<F>(&mut self, f: F) -> &mut Self
|
||||
where
|
||||
F: Fn(Box<Any + Send>) + Send + Sync + 'static,
|
||||
F: Fn(Box<dyn Any + Send>) + Send + Sync + 'static,
|
||||
{
|
||||
self.config.panic_handler = Some(Arc::new(f));
|
||||
self
|
||||
|
||||
@@ -7,7 +7,7 @@ use tokio_executor::Enter;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub(crate) struct Callback {
|
||||
f: Arc<Fn(&Worker, &mut Enter) + Send + Sync>,
|
||||
f: Arc<dyn Fn(&Worker, &mut Enter) + Send + Sync>,
|
||||
}
|
||||
|
||||
impl Callback {
|
||||
|
||||
@@ -13,9 +13,9 @@ pub(crate) struct Config {
|
||||
pub name_prefix: Option<String>,
|
||||
pub stack_size: Option<usize>,
|
||||
pub around_worker: Option<Callback>,
|
||||
pub after_start: Option<Arc<Fn() + Send + Sync>>,
|
||||
pub before_stop: Option<Arc<Fn() + Send + Sync>>,
|
||||
pub panic_handler: Option<Arc<Fn(Box<Any + Send>) + Send + Sync>>,
|
||||
pub after_start: Option<Arc<dyn Fn() + Send + Sync>>,
|
||||
pub before_stop: Option<Arc<dyn Fn() + Send + Sync>>,
|
||||
pub panic_handler: Option<Arc<dyn Fn(Box<dyn Any + Send>) + Send + Sync>>,
|
||||
}
|
||||
|
||||
/// Max number of workers that can be part of a pool. This is the most that can
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#![doc(html_root_url = "https://docs.rs/tokio-threadpool/0.1.15")]
|
||||
#![deny(warnings, missing_docs, missing_debug_implementations)]
|
||||
// Our MSRV doesn't allow us to fix these warnings yet
|
||||
#![allow(rust_2018_idioms)]
|
||||
|
||||
//! A work-stealing based thread pool for executing futures.
|
||||
//!
|
||||
|
||||
@@ -3,8 +3,8 @@ use tokio_executor::park::{Park, Unpark};
|
||||
use std::error::Error;
|
||||
use std::time::Duration;
|
||||
|
||||
pub(crate) type BoxPark = Box<Park<Unpark = BoxUnpark, Error = ()> + Send>;
|
||||
pub(crate) type BoxUnpark = Box<Unpark>;
|
||||
pub(crate) type BoxPark = Box<dyn Park<Unpark = BoxUnpark, Error = ()> + Send>;
|
||||
pub(crate) type BoxUnpark = Box<dyn Unpark>;
|
||||
|
||||
pub(crate) struct BoxedPark<T>(T);
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ impl tokio_executor::Executor for Sender {
|
||||
|
||||
fn spawn(
|
||||
&mut self,
|
||||
future: Box<Future<Item = (), Error = ()> + Send>,
|
||||
future: Box<dyn Future<Item = (), Error = ()> + Send>,
|
||||
) -> Result<(), SpawnError> {
|
||||
let mut s = &*self;
|
||||
tokio_executor::Executor::spawn(&mut s, future)
|
||||
@@ -157,7 +157,7 @@ impl<'a> tokio_executor::Executor for &'a Sender {
|
||||
|
||||
fn spawn(
|
||||
&mut self,
|
||||
future: Box<Future<Item = (), Error = ()> + Send>,
|
||||
future: Box<dyn Future<Item = (), Error = ()> + Send>,
|
||||
) -> Result<(), SpawnError> {
|
||||
self.prepare_for_spawn()?;
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ pub(crate) enum Run {
|
||||
Complete,
|
||||
}
|
||||
|
||||
type BoxFuture = Box<Future<Item = (), Error = ()> + Send + 'static>;
|
||||
type BoxFuture = Box<dyn Future<Item = (), Error = ()> + Send + 'static>;
|
||||
|
||||
// ===== impl Task =====
|
||||
|
||||
|
||||
Reference in New Issue
Block a user