Skip to content

coherence failed to report ambiguity #25456

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
tograd opened this issue May 15, 2015 · 1 comment
Closed

coherence failed to report ambiguity #25456

tograd opened this issue May 15, 2015 · 1 comment

Comments

@tograd
Copy link

tograd commented May 15, 2015

I'm a newbie messing about so I couldn't say if this has been reported before or not (certainly similar ones has been.)

use std::sync::{Arc, Mutex};
use std::thread;
use std::sync::mpsc::channel;


fn main() {

    let channel_collector = Arc::new(Mutex::new(vec!()));

    thread::spawn(move || {

        let (tx, rx) = channel();

        {
            let mut cc = channel_collector.lock().unwrap();
            cc.push(rx); // or tx
        }

    });
}
<anon>:11:5: 11:18 error: internal compiler error: coherence failed to report ambiguity: cannot locate the impl of the trait `core::marker::Send` for the type `[closure <anon>:11:24: 20:6]`
<anon>:11     thread::spawn(move || {

http://is.gd/zmtsnG

@arielb1
Copy link
Contributor

arielb1 commented May 16, 2015

seems to be a duplicate of #25368

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants