forked from mirror/async-std
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
463 B
Rust
21 lines
463 B
Rust
5 years ago
|
#[cfg(feature = "unstable")]
|
||
|
#[test]
|
||
|
fn test_send() -> async_std::io::Result<()> {
|
||
|
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);
|
||
|
|
||
|
Ok(())
|
||
|
})
|
||
|
}
|