]> git.proxmox.com Git - rustc.git/blob - tests/ui/kindck/kindck-send-object2.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / kindck / kindck-send-object2.rs
1 // Continue kindck-send-object1.rs.
2
3 fn assert_send<T:Send>() { }
4 trait Dummy { }
5
6 fn test50() {
7 assert_send::<&'static dyn Dummy>();
8 //~^ ERROR `(dyn Dummy + 'static)` cannot be shared between threads safely [E0277]
9 }
10
11 fn test53() {
12 assert_send::<Box<dyn Dummy>>();
13 //~^ ERROR `dyn Dummy` cannot be sent between threads safely
14 }
15
16 // ...unless they are properly bounded
17 fn test60() {
18 assert_send::<&'static (dyn Dummy + Sync)>();
19 }
20 fn test61() {
21 assert_send::<Box<dyn Dummy + Send>>();
22 }
23
24 fn main() { }