mirror of
https://github.com/async-rs/async-std.git
synced 2025-01-16 02:39:55 +00:00
e9cb238f49
Co-authored-by: Jacob Rothstein <hi@jbr.me>
18 lines
419 B
Rust
18 lines
419 B
Rust
#[cfg(feature = "unstable")]
|
|
#[test]
|
|
fn test_send() {
|
|
use async_std::prelude::*;
|
|
use async_std::{stream, task};
|
|
|
|
task::block_on(async {
|
|
fn test_send_trait<T: Send>(_: &T) {}
|
|
|
|
let stream = stream::repeat(1u8).take(10);
|
|
test_send_trait(&stream);
|
|
|
|
let fut = stream.collect::<Vec<_>>();
|
|
|
|
// This line triggers a compilation error
|
|
test_send_trait(&fut);
|
|
});
|
|
}
|