rust/tests/ui/kindck/kindck-nonsendable-1.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
208 B
Rust
Raw Normal View History

2014-10-02 05:10:09 +00:00
use std::rc::Rc;
fn foo(_x: Rc<usize>) {}
fn bar<F:FnOnce() + Send>(_: F) { }
fn main() {
let x = Rc::new(3);
2014-12-23 09:57:44 +00:00
bar(move|| foo(x));
//~^ ERROR `Rc<usize>` cannot be sent between threads safely
}