mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
13 lines
397 B
Rust
13 lines
397 B
Rust
|
#![feature(once_cell)]
|
||
|
|
||
|
fn require_sync<T: Sync>() {}
|
||
|
//~^ NOTE required by this bound in `require_sync`
|
||
|
//~| NOTE required by a bound in `require_sync`
|
||
|
|
||
|
fn main() {
|
||
|
require_sync::<std::cell::RefCell<()>>();
|
||
|
//~^ ERROR `RefCell<()>` cannot be shared between threads safely
|
||
|
//~| NOTE `RefCell<()>` cannot be shared between threads safely
|
||
|
//~| NOTE use `std::sync::RwLock` instead
|
||
|
}
|