File tree Expand file tree Collapse file tree 2 files changed +26
-11
lines changed Expand file tree Collapse file tree 2 files changed +26
-11
lines changed Original file line number Diff line number Diff line change @@ -821,14 +821,20 @@ pub fn fields(
821
821
#[ doc = #pc_w_doc]
822
822
pub type #pc_w = super :: #mod_:: #base_pc_w;
823
823
} ) ;
824
+
825
+ quote ! {
826
+ super :: #mod_:: #base_pc_w
827
+ }
824
828
} else {
825
829
mod_items. push ( quote ! {
826
830
#[ doc = #pc_w_doc]
827
831
pub type #pc_w = #base_pc_w;
828
832
} ) ;
829
- }
830
833
831
- base_pc_w
834
+ quote ! {
835
+ #base_pc_w
836
+ }
837
+ }
832
838
} ) ;
833
839
834
840
let variants = evs. values
@@ -907,14 +913,23 @@ pub fn fields(
907
913
let sc = & v. sc ;
908
914
909
915
let doc = util:: respace ( & v. doc ) ;
910
- let enum_ = base_pc_w. as_ref ( ) . unwrap_or ( & pc_w) ;
911
- proxy_items. push ( quote ! {
912
- #[ doc = #doc]
913
- #[ inline( always) ]
914
- pub fn #sc( self ) -> & ' a mut W {
915
- self . variant( #enum_:: #pc)
916
- }
917
- } ) ;
916
+ if let Some ( enum_) = base_pc_w. as_ref ( ) {
917
+ proxy_items. push ( quote ! {
918
+ #[ doc = #doc]
919
+ #[ inline( always) ]
920
+ pub fn #sc( self ) -> & ' a mut W {
921
+ self . variant( #enum_:: #pc)
922
+ }
923
+ } ) ;
924
+ } else {
925
+ proxy_items. push ( quote ! {
926
+ #[ doc = #doc]
927
+ #[ inline( always) ]
928
+ pub fn #sc( self ) -> & ' a mut W {
929
+ self . variant( #pc_w:: #pc)
930
+ }
931
+ } ) ;
932
+ }
918
933
}
919
934
}
920
935
Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ pub fn unsuffixed(n: u64) -> Lit {
225
225
Lit :: Int ( n, IntTy :: Unsuffixed )
226
226
}
227
227
228
- #[ derive( Clone ) ]
228
+ #[ derive( Clone , Debug ) ]
229
229
pub struct Base < ' a > {
230
230
pub register : Option < & ' a str > ,
231
231
pub field : & ' a str ,
You can’t perform that action at this time.
0 commit comments