|
10 | 10 |
|
11 | 11 | #![feature(core_intrinsics)]
|
12 | 12 | #![allow(warnings)]
|
| 13 | +#![crate_type = "rlib"] |
13 | 14 |
|
14 | 15 | use std::intrinsics;
|
15 | 16 |
|
16 | 17 | #[derive(Copy, Clone)]
|
17 |
| -struct Foo(i64); |
18 |
| -type Bar = &'static Fn(); |
19 |
| -type Quux = [u8; 100]; |
| 18 | +pub struct Foo(i64); |
| 19 | +pub type Bar = &'static Fn(); |
| 20 | +pub type Quux = [u8; 100]; |
20 | 21 |
|
21 |
| -unsafe fn test_bool_load(p: &mut bool, v: bool) { |
| 22 | +pub unsafe fn test_bool_load(p: &mut bool, v: bool) { |
22 | 23 | intrinsics::atomic_load(p);
|
23 | 24 | //~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `bool`
|
24 | 25 | }
|
25 | 26 |
|
26 |
| -unsafe fn test_bool_store(p: &mut bool, v: bool) { |
| 27 | +pub unsafe fn test_bool_store(p: &mut bool, v: bool) { |
27 | 28 | intrinsics::atomic_store(p, v);
|
28 | 29 | //~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `bool`
|
29 | 30 | }
|
30 | 31 |
|
31 |
| -unsafe fn test_bool_xchg(p: &mut bool, v: bool) { |
| 32 | +pub unsafe fn test_bool_xchg(p: &mut bool, v: bool) { |
32 | 33 | intrinsics::atomic_xchg(p, v);
|
33 | 34 | //~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `bool`
|
34 | 35 | }
|
35 | 36 |
|
36 |
| -unsafe fn test_bool_cxchg(p: &mut bool, v: bool) { |
| 37 | +pub unsafe fn test_bool_cxchg(p: &mut bool, v: bool) { |
37 | 38 | intrinsics::atomic_cxchg(p, v, v);
|
38 | 39 | //~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `bool`
|
39 | 40 | }
|
40 | 41 |
|
41 |
| -unsafe fn test_Foo_load(p: &mut Foo, v: Foo) { |
| 42 | +pub unsafe fn test_Foo_load(p: &mut Foo, v: Foo) { |
42 | 43 | intrinsics::atomic_load(p);
|
43 | 44 | //~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `Foo`
|
44 | 45 | }
|
45 | 46 |
|
46 |
| -unsafe fn test_Foo_store(p: &mut Foo, v: Foo) { |
| 47 | +pub unsafe fn test_Foo_store(p: &mut Foo, v: Foo) { |
47 | 48 | intrinsics::atomic_store(p, v);
|
48 | 49 | //~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `Foo`
|
49 | 50 | }
|
50 | 51 |
|
51 |
| -unsafe fn test_Foo_xchg(p: &mut Foo, v: Foo) { |
| 52 | +pub unsafe fn test_Foo_xchg(p: &mut Foo, v: Foo) { |
52 | 53 | intrinsics::atomic_xchg(p, v);
|
53 | 54 | //~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `Foo`
|
54 | 55 | }
|
55 | 56 |
|
56 |
| -unsafe fn test_Foo_cxchg(p: &mut Foo, v: Foo) { |
| 57 | +pub unsafe fn test_Foo_cxchg(p: &mut Foo, v: Foo) { |
57 | 58 | intrinsics::atomic_cxchg(p, v, v);
|
58 | 59 | //~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `Foo`
|
59 | 60 | }
|
60 | 61 |
|
61 |
| -unsafe fn test_Bar_load(p: &mut Bar, v: Bar) { |
| 62 | +pub unsafe fn test_Bar_load(p: &mut Bar, v: Bar) { |
62 | 63 | intrinsics::atomic_load(p);
|
63 | 64 | //~^ ERROR expected basic integer type, found `&std::ops::Fn()`
|
64 | 65 | }
|
65 | 66 |
|
66 |
| -unsafe fn test_Bar_store(p: &mut Bar, v: Bar) { |
| 67 | +pub unsafe fn test_Bar_store(p: &mut Bar, v: Bar) { |
67 | 68 | intrinsics::atomic_store(p, v);
|
68 | 69 | //~^ ERROR expected basic integer type, found `&std::ops::Fn()`
|
69 | 70 | }
|
70 | 71 |
|
71 |
| -unsafe fn test_Bar_xchg(p: &mut Bar, v: Bar) { |
| 72 | +pub unsafe fn test_Bar_xchg(p: &mut Bar, v: Bar) { |
72 | 73 | intrinsics::atomic_xchg(p, v);
|
73 | 74 | //~^ ERROR expected basic integer type, found `&std::ops::Fn()`
|
74 | 75 | }
|
75 | 76 |
|
76 |
| -unsafe fn test_Bar_cxchg(p: &mut Bar, v: Bar) { |
| 77 | +pub unsafe fn test_Bar_cxchg(p: &mut Bar, v: Bar) { |
77 | 78 | intrinsics::atomic_cxchg(p, v, v);
|
78 | 79 | //~^ ERROR expected basic integer type, found `&std::ops::Fn()`
|
79 | 80 | }
|
80 | 81 |
|
81 |
| -unsafe fn test_Quux_load(p: &mut Quux, v: Quux) { |
| 82 | +pub unsafe fn test_Quux_load(p: &mut Quux, v: Quux) { |
82 | 83 | intrinsics::atomic_load(p);
|
83 | 84 | //~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `[u8; 100]`
|
84 | 85 | }
|
85 | 86 |
|
86 |
| -unsafe fn test_Quux_store(p: &mut Quux, v: Quux) { |
| 87 | +pub unsafe fn test_Quux_store(p: &mut Quux, v: Quux) { |
87 | 88 | intrinsics::atomic_store(p, v);
|
88 | 89 | //~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `[u8; 100]`
|
89 | 90 | }
|
90 | 91 |
|
91 |
| -unsafe fn test_Quux_xchg(p: &mut Quux, v: Quux) { |
| 92 | +pub unsafe fn test_Quux_xchg(p: &mut Quux, v: Quux) { |
92 | 93 | intrinsics::atomic_xchg(p, v);
|
93 | 94 | //~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `[u8; 100]`
|
94 | 95 | }
|
95 | 96 |
|
96 |
| -unsafe fn test_Quux_cxchg(p: &mut Quux, v: Quux) { |
| 97 | +pub unsafe fn test_Quux_cxchg(p: &mut Quux, v: Quux) { |
97 | 98 | intrinsics::atomic_cxchg(p, v, v);
|
98 | 99 | //~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `[u8; 100]`
|
99 | 100 | }
|
100 |
| - |
101 |
| -fn main() {} |
0 commit comments