mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-26 00:00:16 +02:00
sync: add OnceCell (#3591)
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
#![warn(rust_2018_idioms)]
|
||||
#![cfg(feature = "full")]
|
||||
#![allow(clippy::type_complexity)]
|
||||
|
||||
use std::cell::Cell;
|
||||
use std::future::Future;
|
||||
use std::io::{Cursor, SeekFrom};
|
||||
use std::net::SocketAddr;
|
||||
use std::pin::Pin;
|
||||
use std::rc::Rc;
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::time::{Duration, Instant};
|
||||
@@ -265,6 +268,28 @@ async_assert_fn!(tokio::sync::watch::Sender<u8>::closed(_): Send & Sync);
|
||||
async_assert_fn!(tokio::sync::watch::Sender<Cell<u8>>::closed(_): !Send & !Sync);
|
||||
async_assert_fn!(tokio::sync::watch::Sender<Rc<u8>>::closed(_): !Send & !Sync);
|
||||
|
||||
async_assert_fn!(tokio::sync::OnceCell<u8>::get_or_init(
|
||||
_, fn() -> Pin<Box<dyn Future<Output = u8> + Send + Sync>>): Send & Sync);
|
||||
async_assert_fn!(tokio::sync::OnceCell<u8>::get_or_init(
|
||||
_, fn() -> Pin<Box<dyn Future<Output = u8> + Send>>): Send & !Sync);
|
||||
async_assert_fn!(tokio::sync::OnceCell<u8>::get_or_init(
|
||||
_, fn() -> Pin<Box<dyn Future<Output = u8>>>): !Send & !Sync);
|
||||
async_assert_fn!(tokio::sync::OnceCell<Cell<u8>>::get_or_init(
|
||||
_, fn() -> Pin<Box<dyn Future<Output = Cell<u8>> + Send + Sync>>): !Send & !Sync);
|
||||
async_assert_fn!(tokio::sync::OnceCell<Cell<u8>>::get_or_init(
|
||||
_, fn() -> Pin<Box<dyn Future<Output = Cell<u8>> + Send>>): !Send & !Sync);
|
||||
async_assert_fn!(tokio::sync::OnceCell<Cell<u8>>::get_or_init(
|
||||
_, fn() -> Pin<Box<dyn Future<Output = Cell<u8>>>>): !Send & !Sync);
|
||||
async_assert_fn!(tokio::sync::OnceCell<Rc<u8>>::get_or_init(
|
||||
_, fn() -> Pin<Box<dyn Future<Output = Rc<u8>> + Send + Sync>>): !Send & !Sync);
|
||||
async_assert_fn!(tokio::sync::OnceCell<Rc<u8>>::get_or_init(
|
||||
_, fn() -> Pin<Box<dyn Future<Output = Rc<u8>> + Send>>): !Send & !Sync);
|
||||
async_assert_fn!(tokio::sync::OnceCell<Rc<u8>>::get_or_init(
|
||||
_, fn() -> Pin<Box<dyn Future<Output = Rc<u8>>>>): !Send & !Sync);
|
||||
assert_value!(tokio::sync::OnceCell<u8>: Send & Sync);
|
||||
assert_value!(tokio::sync::OnceCell<Cell<u8>>: Send & !Sync);
|
||||
assert_value!(tokio::sync::OnceCell<Rc<u8>>: !Send & !Sync);
|
||||
|
||||
async_assert_fn!(tokio::task::LocalKey<u32>::scope(_, u32, BoxFutureSync<()>): Send & Sync);
|
||||
async_assert_fn!(tokio::task::LocalKey<u32>::scope(_, u32, BoxFutureSend<()>): Send & !Sync);
|
||||
async_assert_fn!(tokio::task::LocalKey<u32>::scope(_, u32, BoxFuture<()>): !Send & !Sync);
|
||||
|
||||
Reference in New Issue
Block a user