@@ -129,7 +129,7 @@ impl StringCache {
129129 assert ! ( current != ptr:: mut_null( ) ) ;
130130
131131 unsafe {
132- ptr:: read ( ptr as * StringCacheEntry ) ;
132+ ptr:: read ( ptr as * const StringCacheEntry ) ;
133133 heap:: deallocate ( ptr as * mut u8 ,
134134 mem:: size_of :: < StringCacheEntry > ( ) , ENTRY_ALIGNMENT ) ;
135135 }
@@ -252,11 +252,11 @@ impl fmt::Show for Atom {
252252impl Str for Atom {
253253 fn as_slice < ' t > ( & ' t self ) -> & ' t str {
254254 let ( atom_type, string_len) = self . get_type_and_inline_len ( ) ;
255- let ptr = self as * Atom as * u8 ;
255+ let ptr = self as * const Atom as * const u8 ;
256256 match atom_type {
257257 Inline => {
258258 unsafe {
259- let data = ptr. offset ( 1 ) as * [ u8 , ..7 ] ;
259+ let data = ptr. offset ( 1 ) as * const [ u8 , ..7 ] ;
260260 str:: raw:: from_utf8 ( ( * data) . slice_to ( string_len) )
261261 }
262262 } ,
@@ -265,7 +265,7 @@ impl Str for Atom {
265265 key. as_slice ( )
266266 } ,
267267 Dynamic => {
268- let hash_value = unsafe { & * ( self . data as * StringCacheEntry ) } ;
268+ let hash_value = unsafe { & * ( self . data as * const StringCacheEntry ) } ;
269269 hash_value. string . as_slice ( )
270270 }
271271 }
@@ -279,6 +279,10 @@ impl StrAllocating for Atom {
279279}
280280
281281impl PartialOrd for Atom {
282+ fn partial_cmp ( & self , other : & Atom ) -> Option < Ordering > {
283+ self . data . partial_cmp ( & other. data )
284+ }
285+
282286 fn lt ( & self , other : & Atom ) -> bool {
283287 if self . data == other. data {
284288 return false ;
@@ -445,7 +449,7 @@ mod tests {
445449
446450 #[ test]
447451 fn test_threads ( ) {
448- for _ in range ( 0 , 100 ) {
452+ for _ in range ( 0u32 , 100u32 ) {
449453 spawn ( proc ( ) {
450454 let _ = Atom :: from_slice ( "a dynamic string" ) ;
451455 let _ = Atom :: from_slice ( "another string" ) ;
@@ -458,12 +462,12 @@ mod tests {
458462 let mut strings0 = vec ! ( ) ;
459463 let mut strings1 = vec ! ( ) ;
460464
461- for _ in range ( 0 , 1000 ) {
465+ for _ in range ( 0u32 , 1000u32 ) {
462466 strings0. push ( "a" ) ;
463467 strings1. push ( "b" ) ;
464468 }
465469
466- let mut eq_count = 0 ;
470+ let mut eq_count = 0u32 ;
467471
468472 b. iter ( || {
469473 for ( s0, s1) in strings0. iter ( ) . zip ( strings1. iter ( ) ) {
@@ -479,12 +483,12 @@ mod tests {
479483 let mut atoms0 = vec ! ( ) ;
480484 let mut atoms1 = vec ! ( ) ;
481485
482- for _ in range ( 0 , 1000 ) {
486+ for _ in range ( 0u32 , 1000u32 ) {
483487 atoms0. push ( Atom :: from_slice ( "a" ) ) ;
484488 atoms1. push ( Atom :: from_slice ( "b" ) ) ;
485489 }
486490
487- let mut eq_count = 0 ;
491+ let mut eq_count = 0u32 ;
488492
489493 b. iter ( || {
490494 for ( a0, a1) in atoms0. iter ( ) . zip ( atoms1. iter ( ) ) {
0 commit comments