@@ -104,7 +104,7 @@ impl Parse for Newtype {
104104 #gate_rustc_only
105105 impl <E : :: rustc_serialize:: Encoder > :: rustc_serialize:: Encodable <E > for #name {
106106 fn encode( & self , e: & mut E ) {
107- e. emit_u32( self . private ) ;
107+ e. emit_u32( self . as_u32 ( ) ) ;
108108 }
109109 }
110110 }
@@ -164,7 +164,7 @@ impl Parse for Newtype {
164164 #[ inline]
165165 fn eq( l: & Option <Self >, r: & Option <Self >) -> bool {
166166 if #max_val < u32 :: MAX {
167- l. map( |i| i. private ) . unwrap_or( #max_val+1 ) == r. map( |i| i. private ) . unwrap_or( #max_val+1 )
167+ l. map( |i| i. as_u32 ( ) ) . unwrap_or( #max_val+1 ) == r. map( |i| i. as_u32 ( ) ) . unwrap_or( #max_val+1 )
168168 } else {
169169 match ( l, r) {
170170 ( Some ( l) , Some ( r) ) => r == l,
@@ -188,7 +188,7 @@ impl Parse for Newtype {
188188 #[ cfg_attr( #gate_rustc_only_cfg, rustc_layout_scalar_valid_range_end( #max) ) ]
189189 #[ cfg_attr( #gate_rustc_only_cfg, rustc_pass_by_value) ]
190190 #vis struct #name {
191- private : u32 ,
191+ private_use_as_methods_instead : u32 ,
192192 }
193193
194194 #( #consts) *
@@ -238,7 +238,7 @@ impl Parse for Newtype {
238238 /// Prefer using `from_u32`.
239239 #[ inline]
240240 #vis const unsafe fn from_u32_unchecked( value: u32 ) -> Self {
241- Self { private : value }
241+ Self { private_use_as_methods_instead : value }
242242 }
243243
244244 /// Extracts the value of this index as a `usize`.
@@ -250,7 +250,7 @@ impl Parse for Newtype {
250250 /// Extracts the value of this index as a `u32`.
251251 #[ inline]
252252 #vis const fn as_u32( self ) -> u32 {
253- self . private
253+ self . private_use_as_methods_instead
254254 }
255255
256256 /// Extracts the value of this index as a `usize`.
0 commit comments