@@ -93,7 +93,7 @@ impl Parse for Newtype {
9393 }
9494 impl <E : :: rustc_serialize:: Encoder > :: rustc_serialize:: Encodable <E > for #name {
9595 fn encode( & self , e: & mut E ) {
96- e. emit_u32( self . private ) ;
96+ e. emit_u32( self . as_u32 ( ) ) ;
9797 }
9898 }
9999 }
@@ -150,7 +150,7 @@ impl Parse for Newtype {
150150 #[ inline]
151151 fn eq( l: & Option <Self >, r: & Option <Self >) -> bool {
152152 if #max_val < u32 :: MAX {
153- l. map( |i| i. private ) . unwrap_or( #max_val+1 ) == r. map( |i| i. private ) . unwrap_or( #max_val+1 )
153+ l. map( |i| i. as_u32 ( ) ) . unwrap_or( #max_val+1 ) == r. map( |i| i. as_u32 ( ) ) . unwrap_or( #max_val+1 )
154154 } else {
155155 match ( l, r) {
156156 ( Some ( l) , Some ( r) ) => r == l,
@@ -174,7 +174,7 @@ impl Parse for Newtype {
174174 #[ rustc_layout_scalar_valid_range_end( #max) ]
175175 #[ rustc_pass_by_value]
176176 #vis struct #name {
177- private : u32 ,
177+ private_use_as_methods_instead : u32 ,
178178 }
179179
180180 #( #consts) *
@@ -224,7 +224,7 @@ impl Parse for Newtype {
224224 /// Prefer using `from_u32`.
225225 #[ inline]
226226 #vis const unsafe fn from_u32_unchecked( value: u32 ) -> Self {
227- Self { private : value }
227+ Self { private_use_as_methods_instead : value as _ }
228228 }
229229
230230 /// Extracts the value of this index as a `usize`.
@@ -236,7 +236,7 @@ impl Parse for Newtype {
236236 /// Extracts the value of this index as a `u32`.
237237 #[ inline]
238238 #vis const fn as_u32( self ) -> u32 {
239- self . private
239+ self . private_use_as_methods_instead as u32
240240 }
241241
242242 /// Extracts the value of this index as a `usize`.
0 commit comments