@@ -77,7 +77,7 @@ fn eii_(
7777 let item = item. into_inner ( ) ;
7878
7979 let ast:: Item {
80- attrs,
80+ mut attrs,
8181 id : _,
8282 span : item_span,
8383 vis,
@@ -145,14 +145,14 @@ fn eii_(
145145 rules : ast:: BlockCheckMode :: Default ,
146146 span,
147147 tokens : None ,
148- could_be_bare_literal : false ,
149148 } ) ,
150149 None ,
151150 ) ,
152151 span,
153152 attrs : ThinVec :: new ( ) ,
154153 tokens : None ,
155154 } ) ) ,
155+ define_opaque : None ,
156156 } ) ) ,
157157 tokens : None ,
158158 } ) ) )
@@ -184,6 +184,21 @@ fn eii_(
184184 }
185185
186186 // 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+ } ) ;
187202 let extern_block = Annotatable :: Item ( P ( ast:: Item {
188203 attrs : ast:: AttrVec :: default ( ) ,
189204 id : ast:: DUMMY_NODE_ID ,
@@ -264,6 +279,7 @@ fn eii_(
264279 eii_macro_for : Some ( ast:: EIIMacroFor {
265280 extern_item_path : ast:: Path :: from_ident ( item_name) ,
266281 impl_unsafe,
282+ span : decl_span,
267283 } ) ,
268284 } ) ,
269285 tokens : None ,
@@ -322,7 +338,7 @@ pub(crate) fn eii_macro_for(
322338 false
323339 } ;
324340
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 } ) ;
326342
327343 // Return the original item and the new methods.
328344 vec ! [ item]
0 commit comments