about summary refs log tree commit diff
path: root/tests/ui/traits/rc-not-send.rs
blob: 83084c6173a002438dfcbd8dc0f9a3dd5fc346a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
//! Test that `Rc<T>` does not implement `Send`.

use std::rc::Rc;

fn requires_send<T: Send>(_: T) {}

fn main() {
    let rc_value = Rc::new(5);
    requires_send(rc_value);
    //~^ ERROR `Rc<{integer}>` cannot be sent between threads safely
}