rust/src/test/ui/kindck/kindck-nonsendable-1.rs
2018-12-25 21:08:33 -07:00

12 lines
217 B
Rust

use std::rc::Rc;
fn foo(_x: Rc<usize>) {}
fn bar<F:FnOnce() + Send>(_: F) { }
fn main() {
let x = Rc::new(3);
bar(move|| foo(x));
//~^ ERROR `std::rc::Rc<usize>` cannot be sent between threads safely
}