Expected XYZ found ()
问题 For example: use futures::future::Future; fn main() { let (stop_tokio, time_to_stop) = tokio::sync::oneshot::channel::<()>(); let handler = std::thread::spawn(|| { tokio::run( time_to_stop, // .map_err(|_| ()) ); }); handler.join().expect("join failed"); } The compiler prints the error: error[E0271]: type mismatch resolving `<tokio_sync::oneshot::Receiver<()> as futures::future::Future>::Error == ()` --> src/main.rs:6:9 | 6 | tokio::run( | ^^^^^^^^^^ expected struct `tokio_sync::oneshot: