@@ -77,7 +77,7 @@ fn eii_(
77
77
let item = item. into_inner ( ) ;
78
78
79
79
let ast:: Item {
80
- attrs,
80
+ mut attrs,
81
81
id : _,
82
82
span : item_span,
83
83
vis,
@@ -145,14 +145,14 @@ fn eii_(
145
145
rules : ast:: BlockCheckMode :: Default ,
146
146
span,
147
147
tokens : None ,
148
- could_be_bare_literal : false ,
149
148
} ) ,
150
149
None ,
151
150
) ,
152
151
span,
153
152
attrs : ThinVec :: new ( ) ,
154
153
tokens : None ,
155
154
} ) ) ,
155
+ define_opaque : None ,
156
156
} ) ) ,
157
157
tokens : None ,
158
158
} ) ) )
@@ -184,6 +184,21 @@ fn eii_(
184
184
}
185
185
186
186
// extern "…" { safe fn item(); }
187
+ // #[eii_mangle_extern]
188
+ attrs. push ( ast:: Attribute {
189
+ kind : ast:: AttrKind :: Normal ( P ( ast:: NormalAttr {
190
+ item : ast:: AttrItem {
191
+ unsafety : ast:: Safety :: Default ,
192
+ path : ast:: Path :: from_ident ( Ident :: new ( sym:: eii_mangle_extern, span) ) ,
193
+ args : ast:: AttrArgs :: Empty ,
194
+ tokens : None ,
195
+ } ,
196
+ tokens : None ,
197
+ } ) ) ,
198
+ id : ecx. sess . psess . attr_id_generator . mk_attr_id ( ) ,
199
+ style : ast:: AttrStyle :: Outer ,
200
+ span,
201
+ } ) ;
187
202
let extern_block = Annotatable :: Item ( P ( ast:: Item {
188
203
attrs : ast:: AttrVec :: default ( ) ,
189
204
id : ast:: DUMMY_NODE_ID ,
@@ -264,6 +279,7 @@ fn eii_(
264
279
eii_macro_for : Some ( ast:: EIIMacroFor {
265
280
extern_item_path : ast:: Path :: from_ident ( item_name) ,
266
281
impl_unsafe,
282
+ span : decl_span,
267
283
} ) ,
268
284
} ) ,
269
285
tokens : None ,
@@ -322,7 +338,7 @@ pub(crate) fn eii_macro_for(
322
338
false
323
339
} ;
324
340
325
- d. eii_macro_for = Some ( EIIMacroFor { extern_item_path, impl_unsafe } ) ;
341
+ d. eii_macro_for = Some ( EIIMacroFor { extern_item_path, impl_unsafe, span } ) ;
326
342
327
343
// Return the original item and the new methods.
328
344
vec ! [ item]
0 commit comments