1313#![ feature( rustc_attrs) ]
1414#![ feature( unboxed_closures) ]
1515#![ feature( link_args) ]
16- #![ crate_type="rlib" ]
17-
16+ #![ crate_type = "rlib" ]
1817
1918// Change function name --------------------------------------------------------
2019#[ cfg( cfail1) ]
21- extern {
20+ extern "C" {
2221 pub fn change_function_name1 ( c : i64 ) -> i32 ;
2322}
2423
2524#[ 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" {
2928 pub fn change_function_name2 ( c : i64 ) -> i32 ;
3029}
3130
32-
33-
3431// Change parameter name -------------------------------------------------------
3532#[ cfg( cfail1) ]
36- extern {
33+ extern "C" {
3734 pub fn change_parameter_name ( c : i64 ) -> i32 ;
3835}
3936
4037#[ 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" {
4441 pub fn change_parameter_name ( d : i64 ) -> i32 ;
4542}
4643
47-
48-
4944// Change parameter type -------------------------------------------------------
5045#[ cfg( cfail1) ]
51- extern {
46+ extern "C" {
5247 pub fn change_parameter_type ( c : i64 ) -> i32 ;
5348}
5449
5550#[ 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" {
5954 pub fn change_parameter_type ( c : i32 ) -> i32 ;
6055}
6156
62-
63-
6457// Change return type ----------------------------------------------------------
6558#[ cfg( cfail1) ]
66- extern {
59+ extern "C" {
6760 pub fn change_return_type ( c : i32 ) -> i32 ;
6861}
6962
7063#[ 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" {
7467 pub fn change_return_type ( c : i32 ) -> i8 ;
7568}
7669
77-
78-
7970// Add parameter ---------------------------------------------------------------
8071#[ cfg( cfail1) ]
81- extern {
72+ extern "C" {
8273 pub fn add_parameter ( c : i32 ) -> i32 ;
8374}
8475
8576#[ 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" {
8980 pub fn add_parameter ( c : i32 , d : i32 ) -> i32 ;
9081}
9182
92-
93-
9483// Add return type -------------------------------------------------------------
9584#[ cfg( cfail1) ]
96- extern {
85+ extern "C" {
9786 pub fn add_return_type ( c : i32 ) ;
9887}
9988
10089#[ 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" {
10493 pub fn add_return_type ( c : i32 ) -> i32 ;
10594}
10695
107-
108-
10996// Make function variadic ------------------------------------------------------
11097#[ cfg( cfail1) ]
111- extern {
98+ extern "C" {
11299 pub fn make_function_variadic ( c : i32 ) ;
113100}
114101
115102#[ 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" {
119106 pub fn make_function_variadic ( c : i32 , ...) ;
120107}
121108
122-
123-
124109// Change calling convention ---------------------------------------------------
125110#[ cfg( cfail1) ]
126111extern "C" {
127112 pub fn change_calling_convention ( c : i32 ) ;
128113}
129114
130115#[ 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" ) ]
133118extern "rust-call" {
134119 pub fn change_calling_convention ( c : i32 ) ;
135120}
136121
137-
138-
139122// Make function public --------------------------------------------------------
140123#[ cfg( cfail1) ]
141- extern {
124+ extern "C" {
142125 fn make_function_public ( c : i32 ) ;
143126}
144127
145128#[ 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" {
149132 pub fn make_function_public ( c : i32 ) ;
150133}
151134
152-
153-
154135// Add function ----------------------------------------------------------------
155136#[ cfg( cfail1) ]
156- extern {
137+ extern "C" {
157138 pub fn add_function1 ( c : i32 ) ;
158139}
159140
160141#[ 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" {
164145 pub fn add_function1 ( c : i32 ) ;
165146 pub fn add_function2 ( ) ;
166147}
167148
168-
169-
170149// Change link-args ------------------------------------------------------------
171150#[ cfg( cfail1) ]
172151#[ link_args = "-foo -bar" ]
173- extern {
152+ extern "C" {
174153 pub fn change_link_args ( c : i32 ) ;
175154}
176155
177156#[ 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" ) ]
180159#[ link_args = "-foo -bar -baz" ]
181- extern {
160+ extern "C" {
182161 pub fn change_link_args ( c : i32 ) ;
183162}
184163
185-
186-
187164// Change link-name ------------------------------------------------------------
188165#[ cfg( cfail1) ]
189166#[ link( name = "foo" ) ]
190- extern {
167+ extern "C" {
191168 pub fn change_link_name ( c : i32 ) ;
192169}
193170
194171#[ 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" ) ]
197174#[ link( name = "bar" ) ]
198- extern {
175+ extern "C" {
199176 pub fn change_link_name ( c : i32 ) ;
200177}
201178
@@ -209,25 +186,23 @@ mod indirectly_change_parameter_type {
209186 #[ cfg( not( cfail1) ) ]
210187 use super :: c_i64 as c_int;
211188
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" {
215192 pub fn indirectly_change_parameter_type ( c : c_int ) ;
216193 }
217194}
218195
219-
220-
221196// Indirectly change return type --------------------------------------------
222197mod indirectly_change_return_type {
223198 #[ cfg( cfail1) ]
224199 use super :: c_i32 as c_int;
225200 #[ cfg( not( cfail1) ) ]
226201 use super :: c_i64 as c_int;
227202
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" {
231206 pub fn indirectly_change_return_type ( ) -> c_int ;
232207 }
233208}
0 commit comments