@@ -43,6 +43,7 @@ impl<'a> State<'a> {
4343 expr,
4444 safety,
4545 define_opaque,
46+ eii_impls,
4647 } ) => self . print_item_const (
4748 * ident,
4849 Some ( * mutability) ,
@@ -53,6 +54,7 @@ impl<'a> State<'a> {
5354 * safety,
5455 ast:: Defaultness :: Implicit ,
5556 define_opaque. as_deref ( ) ,
57+ eii_impls,
5658 ) ,
5759 ast:: ForeignItemKind :: TyAlias ( box ast:: TyAlias {
5860 defaultness,
@@ -93,8 +95,12 @@ impl<'a> State<'a> {
9395 safety : ast:: Safety ,
9496 defaultness : ast:: Defaultness ,
9597 define_opaque : Option < & [ ( ast:: NodeId , ast:: Path ) ] > ,
98+ eii_impls : & [ EiiImpl ] ,
9699 ) {
97100 self . print_define_opaques ( define_opaque) ;
101+ for eii_impl in eii_impls {
102+ self . print_eii_impl ( eii_impl) ;
103+ }
98104 let ( cb, ib) = self . head ( "" ) ;
99105 self . print_visibility ( vis) ;
100106 self . print_safety ( safety) ;
@@ -191,6 +197,7 @@ impl<'a> State<'a> {
191197 mutability : mutbl,
192198 expr : body,
193199 define_opaque,
200+ eii_impls,
194201 } ) => {
195202 self . print_safety ( * safety) ;
196203 self . print_item_const (
@@ -203,6 +210,7 @@ impl<'a> State<'a> {
203210 ast:: Safety :: Default ,
204211 ast:: Defaultness :: Implicit ,
205212 define_opaque. as_deref ( ) ,
213+ eii_impls,
206214 ) ;
207215 }
208216 ast:: ItemKind :: ConstBlock ( ast:: ConstBlockItem { id : _, span : _, block } ) => {
@@ -234,6 +242,7 @@ impl<'a> State<'a> {
234242 ast:: Safety :: Default ,
235243 * defaultness,
236244 define_opaque. as_deref ( ) ,
245+ & [ ] ,
237246 ) ;
238247 }
239248 ast:: ItemKind :: Fn ( func) => {
@@ -602,6 +611,7 @@ impl<'a> State<'a> {
602611 ast:: Safety :: Default ,
603612 * defaultness,
604613 define_opaque. as_deref ( ) ,
614+ & [ ] ,
605615 ) ;
606616 }
607617 ast:: AssocItemKind :: Type ( box ast:: TyAlias {
@@ -703,18 +713,8 @@ impl<'a> State<'a> {
703713
704714 self . print_define_opaques ( define_opaque. as_deref ( ) ) ;
705715
706- for EiiImpl { eii_macro_path, impl_safety, .. } in eii_impls {
707- self . word ( "#[" ) ;
708- if let Safety :: Unsafe ( ..) = impl_safety {
709- self . word ( "unsafe" ) ;
710- self . popen ( ) ;
711- }
712- self . print_path ( eii_macro_path, false , 0 ) ;
713- if let Safety :: Unsafe ( ..) = impl_safety {
714- self . pclose ( ) ;
715- }
716- self . word ( "]" ) ;
717- self . hardbreak ( ) ;
716+ for eii_impl in eii_impls {
717+ self . print_eii_impl ( eii_impl) ;
718718 }
719719
720720 let body_cb_ib = body. as_ref ( ) . map ( |body| ( body, self . head ( "" ) ) ) ;
@@ -741,6 +741,20 @@ impl<'a> State<'a> {
741741 }
742742 }
743743
744+ fn print_eii_impl ( & mut self , eii : & ast:: EiiImpl ) {
745+ self . word ( "#[" ) ;
746+ if let Safety :: Unsafe ( ..) = eii. impl_safety {
747+ self . word ( "unsafe" ) ;
748+ self . popen ( ) ;
749+ }
750+ self . print_path ( & eii. eii_macro_path , false , 0 ) ;
751+ if let Safety :: Unsafe ( ..) = eii. impl_safety {
752+ self . pclose ( ) ;
753+ }
754+ self . word ( "]" ) ;
755+ self . hardbreak ( ) ;
756+ }
757+
744758 fn print_define_opaques ( & mut self , define_opaque : Option < & [ ( ast:: NodeId , ast:: Path ) ] > ) {
745759 if let Some ( define_opaque) = define_opaque {
746760 self . word ( "#[define_opaque(" ) ;
0 commit comments