Skip to content

when seemingly allows non-send/sync items #31

@aDotInTheVoid

Description

@aDotInTheVoid
use std::rc::Rc;

use boxcars::{when, with_scheduler, Cown};

fn main() {
    with_scheduler(|| {
        let x = std::rc::Rc::new("hello");
        let y = Rc::clone(&x);
        when(&Cown::new(x), |cown| {
            dbg!(cown);
        });
        when(&Cown::new(y), |cown| {
            dbg!(cown);
        })
    })
}

compiles, but shouldnt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions