]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/auxiliary/issue-2526.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / issues / auxiliary / issue-2526.rs
CommitLineData
1a4d82fc
JJ
1#![crate_name="issue_2526"]
2#![crate_type = "lib"]
223e47cc 3
85aaf69f
SL
4use std::marker;
5
9cc50fc6 6pub struct arc_destruct<T: Sync> {
c34b1796 7 _data: isize,
85aaf69f 8 _marker: marker::PhantomData<T>
223e47cc
LB
9}
10
1a4d82fc
JJ
11impl<T: Sync> Drop for arc_destruct<T> {
12 fn drop(&mut self) {}
223e47cc
LB
13}
14
c34b1796 15fn arc_destruct<T: Sync>(data: isize) -> arc_destruct<T> {
223e47cc 16 arc_destruct {
85aaf69f
SL
17 _data: data,
18 _marker: marker::PhantomData
223e47cc
LB
19 }
20}
21
1a4d82fc 22fn arc<T: Sync>(_data: T) -> arc_destruct<T> {
223e47cc
LB
23 arc_destruct(0)
24}
25
26fn init() -> arc_destruct<context_res> {
1a4d82fc 27 arc(context_res())
223e47cc
LB
28}
29
9cc50fc6 30pub struct context_res {
c34b1796 31 ctx : isize,
223e47cc
LB
32}
33
34impl Drop for context_res {
1a4d82fc 35 fn drop(&mut self) {}
223e47cc
LB
36}
37
38fn context_res() -> context_res {
39 context_res {
40 ctx: 0
41 }
42}
43
44pub type context = arc_destruct<context_res>;