]> git.lizzy.rs Git - rust.git/blob - src/test/ui/no-send-res-ports.rs
Rollup merge of #68253 - japaric:bare-metal-cortex-a, r=alexcrichton
[rust.git] / src / test / ui / no-send-res-ports.rs
1 // FIXME: missing sysroot spans (#53081)
2 // ignore-i586-unknown-linux-gnu
3 // ignore-i586-unknown-linux-musl
4 // ignore-i686-unknown-linux-musl
5 use std::thread;
6 use std::rc::Rc;
7
8 #[derive(Debug)]
9 struct Port<T>(Rc<T>);
10
11 fn main() {
12     #[derive(Debug)]
13     struct Foo {
14       _x: Port<()>,
15     }
16
17     impl Drop for Foo {
18         fn drop(&mut self) {}
19     }
20
21     fn foo(x: Port<()>) -> Foo {
22         Foo {
23             _x: x
24         }
25     }
26
27     let x = foo(Port(Rc::new(())));
28
29     thread::spawn(move|| {
30         //~^ ERROR `std::rc::Rc<()>` cannot be sent between threads safely
31         let y = x;
32         println!("{:?}", y);
33     });
34 }