13
13
#![ feature( rustc_attrs) ]
14
14
#![ feature( unboxed_closures) ]
15
15
#![ feature( link_args) ]
16
- #![ crate_type="rlib" ]
17
-
16
+ #![ crate_type = "rlib" ]
18
17
19
18
// Change function name --------------------------------------------------------
20
19
#[ cfg( cfail1) ]
21
- extern {
20
+ extern "C" {
22
21
pub fn change_function_name1 ( c : i64 ) -> i32 ;
23
22
}
24
23
25
24
#[ cfg( not( cfail1) ) ]
26
- #[ rustc_dirty( cfg= "cfail2" ) ]
27
- #[ rustc_clean( cfg= "cfail3" ) ]
28
- extern {
25
+ #[ rustc_dirty( cfg = "cfail2" , except = "hir_owner_nodes ") ]
26
+ #[ rustc_clean( cfg = "cfail3" ) ]
27
+ extern "C" {
29
28
pub fn change_function_name2 ( c : i64 ) -> i32 ;
30
29
}
31
30
32
-
33
-
34
31
// Change parameter name -------------------------------------------------------
35
32
#[ cfg( cfail1) ]
36
- extern {
33
+ extern "C" {
37
34
pub fn change_parameter_name ( c : i64 ) -> i32 ;
38
35
}
39
36
40
37
#[ cfg( not( cfail1) ) ]
41
- #[ rustc_dirty( cfg= "cfail2" ) ]
42
- #[ rustc_clean( cfg= "cfail3" ) ]
43
- extern {
38
+ #[ rustc_dirty( cfg = "cfail2" , except = "hir_owner,hir_owner_nodes ") ]
39
+ #[ rustc_clean( cfg = "cfail3" ) ]
40
+ extern "C" {
44
41
pub fn change_parameter_name ( d : i64 ) -> i32 ;
45
42
}
46
43
47
-
48
-
49
44
// Change parameter type -------------------------------------------------------
50
45
#[ cfg( cfail1) ]
51
- extern {
46
+ extern "C" {
52
47
pub fn change_parameter_type ( c : i64 ) -> i32 ;
53
48
}
54
49
55
50
#[ cfg( not( cfail1) ) ]
56
- #[ rustc_dirty( cfg= "cfail2" ) ]
57
- #[ rustc_clean( cfg= "cfail3" ) ]
58
- extern {
51
+ #[ rustc_dirty( cfg = "cfail2" , except = "hir_owner,hir_owner_nodes ") ]
52
+ #[ rustc_clean( cfg = "cfail3" ) ]
53
+ extern "C" {
59
54
pub fn change_parameter_type ( c : i32 ) -> i32 ;
60
55
}
61
56
62
-
63
-
64
57
// Change return type ----------------------------------------------------------
65
58
#[ cfg( cfail1) ]
66
- extern {
59
+ extern "C" {
67
60
pub fn change_return_type ( c : i32 ) -> i32 ;
68
61
}
69
62
70
63
#[ cfg( not( cfail1) ) ]
71
- #[ rustc_dirty( cfg= "cfail2" ) ]
72
- #[ rustc_clean( cfg= "cfail3" ) ]
73
- extern {
64
+ #[ rustc_dirty( cfg = "cfail2" , except = "hir_owner,hir_owner_nodes ") ]
65
+ #[ rustc_clean( cfg = "cfail3" ) ]
66
+ extern "C" {
74
67
pub fn change_return_type ( c : i32 ) -> i8 ;
75
68
}
76
69
77
-
78
-
79
70
// Add parameter ---------------------------------------------------------------
80
71
#[ cfg( cfail1) ]
81
- extern {
72
+ extern "C" {
82
73
pub fn add_parameter ( c : i32 ) -> i32 ;
83
74
}
84
75
85
76
#[ cfg( not( cfail1) ) ]
86
- #[ rustc_dirty( cfg= "cfail2" ) ]
87
- #[ rustc_clean( cfg= "cfail3" ) ]
88
- extern {
77
+ #[ rustc_dirty( cfg = "cfail2" , except = "hir_owner,hir_owner_nodes ") ]
78
+ #[ rustc_clean( cfg = "cfail3" ) ]
79
+ extern "C" {
89
80
pub fn add_parameter ( c : i32 , d : i32 ) -> i32 ;
90
81
}
91
82
92
-
93
-
94
83
// Add return type -------------------------------------------------------------
95
84
#[ cfg( cfail1) ]
96
- extern {
85
+ extern "C" {
97
86
pub fn add_return_type ( c : i32 ) ;
98
87
}
99
88
100
89
#[ cfg( not( cfail1) ) ]
101
- #[ rustc_dirty( cfg= "cfail2" ) ]
102
- #[ rustc_clean( cfg= "cfail3" ) ]
103
- extern {
90
+ #[ rustc_dirty( cfg = "cfail2" , except = "hir_owner,hir_owner_nodes ") ]
91
+ #[ rustc_clean( cfg = "cfail3" ) ]
92
+ extern "C" {
104
93
pub fn add_return_type ( c : i32 ) -> i32 ;
105
94
}
106
95
107
-
108
-
109
96
// Make function variadic ------------------------------------------------------
110
97
#[ cfg( cfail1) ]
111
- extern {
98
+ extern "C" {
112
99
pub fn make_function_variadic ( c : i32 ) ;
113
100
}
114
101
115
102
#[ cfg( not( cfail1) ) ]
116
- #[ rustc_dirty( cfg= "cfail2" ) ]
117
- #[ rustc_clean( cfg= "cfail3" ) ]
118
- extern {
103
+ #[ rustc_dirty( cfg = "cfail2" , except = "hir_owner,hir_owner_nodes ") ]
104
+ #[ rustc_clean( cfg = "cfail3" ) ]
105
+ extern "C" {
119
106
pub fn make_function_variadic ( c : i32 , ...) ;
120
107
}
121
108
122
-
123
-
124
109
// Change calling convention ---------------------------------------------------
125
110
#[ cfg( cfail1) ]
126
111
extern "C" {
127
112
pub fn change_calling_convention ( c : i32 ) ;
128
113
}
129
114
130
115
#[ cfg( not( cfail1) ) ]
131
- #[ rustc_dirty( cfg= "cfail2" ) ]
132
- #[ rustc_clean( cfg= "cfail3" ) ]
116
+ #[ rustc_dirty( cfg = "cfail2" , except = "hir_owner_nodes ") ]
117
+ #[ rustc_clean( cfg = "cfail3" ) ]
133
118
extern "rust-call" {
134
119
pub fn change_calling_convention ( c : i32 ) ;
135
120
}
136
121
137
-
138
-
139
122
// Make function public --------------------------------------------------------
140
123
#[ cfg( cfail1) ]
141
- extern {
124
+ extern "C" {
142
125
fn make_function_public ( c : i32 ) ;
143
126
}
144
127
145
128
#[ cfg( not( cfail1) ) ]
146
- #[ rustc_dirty( cfg= "cfail2" ) ]
147
- #[ rustc_clean( cfg= "cfail3" ) ]
148
- extern {
129
+ #[ rustc_dirty( cfg = "cfail2" , except = "hir_owner_nodes ") ]
130
+ #[ rustc_clean( cfg = "cfail3" ) ]
131
+ extern "C" {
149
132
pub fn make_function_public ( c : i32 ) ;
150
133
}
151
134
152
-
153
-
154
135
// Add function ----------------------------------------------------------------
155
136
#[ cfg( cfail1) ]
156
- extern {
137
+ extern "C" {
157
138
pub fn add_function1 ( c : i32 ) ;
158
139
}
159
140
160
141
#[ cfg( not( cfail1) ) ]
161
- #[ rustc_dirty( cfg= "cfail2" ) ]
162
- #[ rustc_clean( cfg= "cfail3" ) ]
163
- extern {
142
+ #[ rustc_dirty( cfg = "cfail2" , except = "hir_owner_nodes ") ]
143
+ #[ rustc_clean( cfg = "cfail3" ) ]
144
+ extern "C" {
164
145
pub fn add_function1 ( c : i32 ) ;
165
146
pub fn add_function2 ( ) ;
166
147
}
167
148
168
-
169
-
170
149
// Change link-args ------------------------------------------------------------
171
150
#[ cfg( cfail1) ]
172
151
#[ link_args = "-foo -bar" ]
173
- extern {
152
+ extern "C" {
174
153
pub fn change_link_args ( c : i32 ) ;
175
154
}
176
155
177
156
#[ cfg( not( cfail1) ) ]
178
- #[ rustc_dirty( cfg= "cfail2" ) ]
179
- #[ rustc_clean( cfg= "cfail3" ) ]
157
+ #[ rustc_dirty( cfg = "cfail2" , except = "hir_owner_nodes ") ]
158
+ #[ rustc_clean( cfg = "cfail3" ) ]
180
159
#[ link_args = "-foo -bar -baz" ]
181
- extern {
160
+ extern "C" {
182
161
pub fn change_link_args ( c : i32 ) ;
183
162
}
184
163
185
-
186
-
187
164
// Change link-name ------------------------------------------------------------
188
165
#[ cfg( cfail1) ]
189
166
#[ link( name = "foo" ) ]
190
- extern {
167
+ extern "C" {
191
168
pub fn change_link_name ( c : i32 ) ;
192
169
}
193
170
194
171
#[ cfg( not( cfail1) ) ]
195
- #[ rustc_dirty( cfg= "cfail2" ) ]
196
- #[ rustc_clean( cfg= "cfail3" ) ]
172
+ #[ rustc_dirty( cfg = "cfail2" , except = "hir_owner_nodes ") ]
173
+ #[ rustc_clean( cfg = "cfail3" ) ]
197
174
#[ link( name = "bar" ) ]
198
- extern {
175
+ extern "C" {
199
176
pub fn change_link_name ( c : i32 ) ;
200
177
}
201
178
@@ -209,25 +186,23 @@ mod indirectly_change_parameter_type {
209
186
#[ cfg( not( cfail1) ) ]
210
187
use super :: c_i64 as c_int;
211
188
212
- #[ rustc_dirty( cfg= "cfail2" ) ]
213
- #[ rustc_clean( cfg= "cfail3" ) ]
214
- extern {
189
+ #[ rustc_dirty( cfg = "cfail2" , except = "hir_owner,hir_owner_nodes ") ]
190
+ #[ rustc_clean( cfg = "cfail3" ) ]
191
+ extern "C" {
215
192
pub fn indirectly_change_parameter_type ( c : c_int ) ;
216
193
}
217
194
}
218
195
219
-
220
-
221
196
// Indirectly change return type --------------------------------------------
222
197
mod indirectly_change_return_type {
223
198
#[ cfg( cfail1) ]
224
199
use super :: c_i32 as c_int;
225
200
#[ cfg( not( cfail1) ) ]
226
201
use super :: c_i64 as c_int;
227
202
228
- #[ rustc_dirty( cfg= "cfail2" ) ]
229
- #[ rustc_clean( cfg= "cfail3" ) ]
230
- extern {
203
+ #[ rustc_dirty( cfg = "cfail2" , except = "hir_owner,hir_owner_nodes ") ]
204
+ #[ rustc_clean( cfg = "cfail3" ) ]
205
+ extern "C" {
231
206
pub fn indirectly_change_return_type ( ) -> c_int ;
232
207
}
233
208
}
0 commit comments