@@ -295,14 +295,13 @@ fn gen_enumflags(ast: &mut ItemEnum, default: Vec<Ident>) -> Result<TokenStream,
295295
296296 let std_path = quote_spanned ! ( span => :: enumflags2:: _internal:: core) ;
297297 let variant_names = ast. variants . iter ( ) . map ( |v| & v. ident ) . collect :: < Vec < _ > > ( ) ;
298- let repeated_name = vec ! [ & ident; ast. variants. len( ) ] ;
299298
300299 Ok ( quote_spanned ! {
301300 span =>
302301 #ast
303302 #( #deferred) *
304303 impl #std_path:: ops:: Not for #ident {
305- type Output = :: enumflags2:: BitFlags <#ident >;
304+ type Output = :: enumflags2:: BitFlags <Self >;
306305 #[ inline( always) ]
307306 fn not( self ) -> Self :: Output {
308307 use :: enumflags2:: { BitFlags , _internal:: RawBitFlags } ;
@@ -311,7 +310,7 @@ fn gen_enumflags(ast: &mut ItemEnum, default: Vec<Ident>) -> Result<TokenStream,
311310 }
312311
313312 impl #std_path:: ops:: BitOr for #ident {
314- type Output = :: enumflags2:: BitFlags <#ident >;
313+ type Output = :: enumflags2:: BitFlags <Self >;
315314 #[ inline( always) ]
316315 fn bitor( self , other: Self ) -> Self :: Output {
317316 use :: enumflags2:: { BitFlags , _internal:: RawBitFlags } ;
@@ -320,7 +319,7 @@ fn gen_enumflags(ast: &mut ItemEnum, default: Vec<Ident>) -> Result<TokenStream,
320319 }
321320
322321 impl #std_path:: ops:: BitAnd for #ident {
323- type Output = :: enumflags2:: BitFlags <#ident >;
322+ type Output = :: enumflags2:: BitFlags <Self >;
324323 #[ inline( always) ]
325324 fn bitand( self , other: Self ) -> Self :: Output {
326325 use :: enumflags2:: { BitFlags , _internal:: RawBitFlags } ;
@@ -329,7 +328,7 @@ fn gen_enumflags(ast: &mut ItemEnum, default: Vec<Ident>) -> Result<TokenStream,
329328 }
330329
331330 impl #std_path:: ops:: BitXor for #ident {
332- type Output = :: enumflags2:: BitFlags <#ident >;
331+ type Output = :: enumflags2:: BitFlags <Self >;
333332 #[ inline( always) ]
334333 fn bitxor( self , other: Self ) -> Self :: Output {
335334 #std_path:: convert:: Into :: <Self :: Output >:: into( self ) ^ #std_path:: convert:: Into :: <Self :: Output >:: into( other)
@@ -342,13 +341,13 @@ fn gen_enumflags(ast: &mut ItemEnum, default: Vec<Ident>) -> Result<TokenStream,
342341 const EMPTY : Self :: Numeric = 0 ;
343342
344343 const DEFAULT : Self :: Numeric =
345- 0 #( | ( #repeated_name :: #default as #repr) ) * ;
344+ 0 #( | ( Self :: #default as #repr) ) * ;
346345
347346 const ALL_BITS : Self :: Numeric =
348- 0 #( | ( #repeated_name :: #variant_names as #repr) ) * ;
347+ 0 #( | ( Self :: #variant_names as #repr) ) * ;
349348
350349 const FLAG_LIST : & ' static [ Self ] =
351- & [ #( #repeated_name :: #variant_names) , * ] ;
350+ & [ #( Self :: #variant_names) , * ] ;
352351
353352 const BITFLAGS_TYPE_NAME : & ' static str =
354353 concat!( "BitFlags<" , stringify!( #ident) , ">" ) ;
0 commit comments