File: collect.rs

package info (click to toggle)
rust-async-std 1.13.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,992 kB
  • sloc: sh: 13; makefile: 8
file content (18 lines) | stat: -rw-r--r-- 419 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[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);
    });
}