]> git.lizzy.rs Git - rust.git/blob - tests/ui/fmt/send-sync.rs
Rollup merge of #105784 - yanns:update_stdarch, r=Amanieu
[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 }