Files
rust/tests/ui/traits/rc-not-send.rs

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

12 lines
247 B
Rust
Raw Normal View History

2025-06-29 23:13:37 +05:00
//! Test that `Rc<T>` does not implement `Send`.
use std::rc::Rc;
2025-06-29 23:13:37 +05:00
fn requires_send<T: Send>(_: T) {}
fn main() {
2025-06-29 23:13:37 +05:00
let rc_value = Rc::new(5);
requires_send(rc_value);
//~^ ERROR `Rc<{integer}>` cannot be sent between threads safely
}