]> git.lizzy.rs Git - rust.git/blob - src/test/ui/fmt/send-sync.rs
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[rust.git] / src / test / 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 }