Skip to content

futures-channel fails under Miri #2669

Closed
@GoldsteinE

Description

@GoldsteinE

Discovered while discussing rust-lang/unsafe-code-guidelines#380, probably related to rust-lang/unsafe-code-guidelines#148.

This code (playground):

use std::thread;
use futures::{channel::mpsc, executor::block_on, sink::SinkExt, stream::StreamExt};

async fn send_sequence(n: u32, mut sender: mpsc::Sender<u32>) {
    for x in 0..n {
        sender.send(n - x).await.unwrap();
    }
}

fn main() {
    let (tx, rx) = mpsc::channel(1);
    let t = thread::spawn(move || block_on(send_sequence(20, tx)));
    let _list: Vec<_> = block_on(rx.collect());
    t.join().unwrap();
}

fails under Miri.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions