future_send.rs 524 B

12345678910111213141516171819202122
  1. // These tests reproduce the following issues:
  2. // - https://github.com/tokio-rs/tracing/issues/1487
  3. // - https://github.com/tokio-rs/tracing/issues/1793
  4. use core::future::{self, Future};
  5. #[test]
  6. fn async_fn_is_send() {
  7. async fn some_async_fn() {
  8. tracing::info!("{}", future::ready("test").await);
  9. }
  10. assert_send(some_async_fn())
  11. }
  12. #[test]
  13. fn async_block_is_send() {
  14. assert_send(async {
  15. tracing::info!("{}", future::ready("test").await);
  16. })
  17. }
  18. fn assert_send<F: Future + Send>(_f: F) {}