]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/suggestions/restrict-type-argument.rs
1 fn is_send
<T
: Send
>(val
: T
) {}
3 fn use_impl_sync(val
: impl Sync
) {
4 is_send(val
); //~ ERROR `impl Sync` cannot be sent between threads safely
7 fn use_where
<S
>(val
: S
) where S
: Sync
{
8 is_send(val
); //~ ERROR `S` cannot be sent between threads safely
11 fn use_bound
<S
: Sync
>(val
: S
) {
12 is_send(val
); //~ ERROR `S` cannot be sent between threads safely
16 S
// Make sure we can synthezise a correct suggestion span for this case
20 is_send(val
); //~ ERROR `S` cannot be sent between threads safely
23 fn use_bound_and_where
<S
: Sync
>(val
: S
) where S
: std
::fmt
::Debug
{
24 is_send(val
); //~ ERROR `S` cannot be sent between threads safely
27 fn use_unbound
<S
>(val
: S
) {
28 is_send(val
); //~ ERROR `S` cannot be sent between threads safely