]> git.lizzy.rs Git - rust.git/blob - tests/ui/fmt/send-sync.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / fmt / send-sync.rs
1 fn send<T: Send>(_: T) {}
2 fn sync<T: Sync>(_: T) {}
3
4 fn main() {
5     // `Cell` is not `Sync`, so `&Cell` is neither `Sync` nor `Send`,
6     // `std::fmt::Arguments` used to forget this...
7     let c = std::cell::Cell::new(42);
8     send(format_args!("{:?}", c)); //~ ERROR E0277
9     sync(format_args!("{:?}", c)); //~ ERROR E0277
10 }