File tree 7 files changed +16
-16
lines changed
7 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -243,24 +243,22 @@ fn test_siphash_2_4() {
243
243
t += 1 ;
244
244
}
245
245
}
246
- #[ test] #[ cfg( target_arch = "arm" ) ]
246
+
247
+ #[ test]
248
+ #[ cfg( target_pointer_width = "32" ) ]
247
249
fn test_hash_usize ( ) {
248
250
let val = 0xdeadbeef_deadbeef_u64 ;
249
251
assert ! ( hash( & ( val as u64 ) ) != hash( & ( val as usize ) ) ) ;
250
252
assert_eq ! ( hash( & ( val as u32 ) ) , hash( & ( val as usize ) ) ) ;
251
253
}
252
- #[ test] #[ cfg( target_arch = "x86_64" ) ]
254
+
255
+ #[ test]
256
+ #[ cfg( target_pointer_width = "64" ) ]
253
257
fn test_hash_usize ( ) {
254
258
let val = 0xdeadbeef_deadbeef_u64 ;
255
259
assert_eq ! ( hash( & ( val as u64 ) ) , hash( & ( val as usize ) ) ) ;
256
260
assert ! ( hash( & ( val as u32 ) ) != hash( & ( val as usize ) ) ) ;
257
261
}
258
- #[ test] #[ cfg( target_arch = "x86" ) ]
259
- fn test_hash_usize ( ) {
260
- let val = 0xdeadbeef_deadbeef_u64 ;
261
- assert ! ( hash( & ( val as u64 ) ) != hash( & ( val as usize ) ) ) ;
262
- assert_eq ! ( hash( & ( val as u32 ) ) , hash( & ( val as usize ) ) ) ;
263
- }
264
262
265
263
#[ test]
266
264
fn test_hash_idempotent ( ) {
Original file line number Diff line number Diff line change @@ -92,14 +92,15 @@ impl Condvar {
92
92
assert_eq ! ( r, 0 ) ;
93
93
94
94
// Nanosecond calculations can't overflow because both values are below 1e9.
95
- let nsec = dur. subsec_nanos ( ) as libc:: c_long + now. tv_nsec as libc:: c_long ;
95
+ let nsec = dur. subsec_nanos ( ) + now. tv_nsec as u32 ;
96
+
96
97
let sec = saturating_cast_to_time_t ( dur. as_secs ( ) )
97
98
. checked_add ( ( nsec / 1_000_000_000 ) as libc:: time_t )
98
99
. and_then ( |s| s. checked_add ( now. tv_sec ) ) ;
99
100
let nsec = nsec % 1_000_000_000 ;
100
101
101
102
let timeout = sec. map ( |s| {
102
- libc:: timespec { tv_sec : s, tv_nsec : nsec }
103
+ libc:: timespec { tv_sec : s, tv_nsec : nsec as _ }
103
104
} ) . unwrap_or ( TIMESPEC_MAX ) ;
104
105
105
106
let r = libc:: pthread_cond_timedwait ( self . inner . get ( ) , mutex:: raw ( mutex) ,
Original file line number Diff line number Diff line change @@ -132,14 +132,14 @@ impl FileAttr {
132
132
pub fn modified ( & self ) -> io:: Result < SystemTime > {
133
133
Ok ( SystemTime :: from ( libc:: timespec {
134
134
tv_sec : self . stat . st_mtime as libc:: time_t ,
135
- tv_nsec : self . stat . st_mtime_nsec as libc :: c_long ,
135
+ tv_nsec : self . stat . st_mtime_nsec as _ ,
136
136
} ) )
137
137
}
138
138
139
139
pub fn accessed ( & self ) -> io:: Result < SystemTime > {
140
140
Ok ( SystemTime :: from ( libc:: timespec {
141
141
tv_sec : self . stat . st_atime as libc:: time_t ,
142
- tv_nsec : self . stat . st_atime_nsec as libc :: c_long ,
142
+ tv_nsec : self . stat . st_atime_nsec as _ ,
143
143
} ) )
144
144
}
145
145
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ impl Thread {
149
149
150
150
pub fn sleep ( dur : Duration ) {
151
151
let mut secs = dur. as_secs ( ) ;
152
- let mut nsecs = dur. subsec_nanos ( ) as libc :: c_long ;
152
+ let mut nsecs = dur. subsec_nanos ( ) as _ ;
153
153
154
154
// If we're awoken with a signal then the return value will be -1 and
155
155
// nanosleep will fill in `ts` with the remaining time.
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ impl Timespec {
60
60
Timespec {
61
61
t : libc:: timespec {
62
62
tv_sec : secs,
63
- tv_nsec : nsec as libc :: c_long ,
63
+ tv_nsec : nsec as _ ,
64
64
} ,
65
65
}
66
66
}
@@ -83,7 +83,7 @@ impl Timespec {
83
83
Timespec {
84
84
t : libc:: timespec {
85
85
tv_sec : secs,
86
- tv_nsec : nsec as libc :: c_long ,
86
+ tv_nsec : nsec as _ ,
87
87
} ,
88
88
}
89
89
}
Original file line number Diff line number Diff line change 13
13
// ignore-x86
14
14
// ignore-arm
15
15
// ignore-emscripten
16
+ // ignore-gnux32
16
17
// ignore 32-bit platforms (LLVM has a bug with them)
17
18
18
19
// See issue #37945.
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ pub fn get_env(triple: &str) -> Option<&str> {
73
73
}
74
74
75
75
pub fn get_pointer_width ( triple : & str ) -> & ' static str {
76
- if triple. contains ( "64" ) || triple. starts_with ( "s390x" ) {
76
+ if ( triple. contains ( "64" ) && !triple . ends_with ( "gnux32" ) ) || triple. starts_with ( "s390x" ) {
77
77
"64bit"
78
78
} else {
79
79
"32bit"
You can’t perform that action at this time.
0 commit comments