Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
e57ee3d0
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e57ee3d0
编写于
10月 19, 2017
作者:
M
Marco A L Barbosa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix some tests for linux gnux32
上级
dbcd1bec
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
16 addition
and
16 deletion
+16
-16
src/libcore/tests/hash/sip.rs
src/libcore/tests/hash/sip.rs
+6
-8
src/libstd/sys/unix/condvar.rs
src/libstd/sys/unix/condvar.rs
+3
-2
src/libstd/sys/unix/fs.rs
src/libstd/sys/unix/fs.rs
+2
-2
src/libstd/sys/unix/thread.rs
src/libstd/sys/unix/thread.rs
+1
-1
src/libstd/sys/unix/time.rs
src/libstd/sys/unix/time.rs
+2
-2
src/test/codegen/issue-37945.rs
src/test/codegen/issue-37945.rs
+1
-0
src/tools/compiletest/src/util.rs
src/tools/compiletest/src/util.rs
+1
-1
未找到文件。
src/libcore/tests/hash/sip.rs
浏览文件 @
e57ee3d0
...
@@ -243,24 +243,22 @@ fn test_siphash_2_4() {
...
@@ -243,24 +243,22 @@ fn test_siphash_2_4() {
t
+=
1
;
t
+=
1
;
}
}
}
}
#[test]
#[cfg(target_arch
=
"arm"
)]
#[test]
#[cfg(target_pointer_width
=
"32"
)]
fn
test_hash_usize
()
{
fn
test_hash_usize
()
{
let
val
=
0xdeadbeef_deadbeef_u64
;
let
val
=
0xdeadbeef_deadbeef_u64
;
assert
!
(
hash
(
&
(
val
as
u64
))
!=
hash
(
&
(
val
as
usize
)));
assert
!
(
hash
(
&
(
val
as
u64
))
!=
hash
(
&
(
val
as
usize
)));
assert_eq!
(
hash
(
&
(
val
as
u32
)),
hash
(
&
(
val
as
usize
)));
assert_eq!
(
hash
(
&
(
val
as
u32
)),
hash
(
&
(
val
as
usize
)));
}
}
#[test]
#[cfg(target_arch
=
"x86_64"
)]
#[test]
#[cfg(target_pointer_width
=
"64"
)]
fn
test_hash_usize
()
{
fn
test_hash_usize
()
{
let
val
=
0xdeadbeef_deadbeef_u64
;
let
val
=
0xdeadbeef_deadbeef_u64
;
assert_eq!
(
hash
(
&
(
val
as
u64
)),
hash
(
&
(
val
as
usize
)));
assert_eq!
(
hash
(
&
(
val
as
u64
)),
hash
(
&
(
val
as
usize
)));
assert
!
(
hash
(
&
(
val
as
u32
))
!=
hash
(
&
(
val
as
usize
)));
assert
!
(
hash
(
&
(
val
as
u32
))
!=
hash
(
&
(
val
as
usize
)));
}
}
#[test]
#[cfg(target_arch
=
"x86"
)]
fn
test_hash_usize
()
{
let
val
=
0xdeadbeef_deadbeef_u64
;
assert
!
(
hash
(
&
(
val
as
u64
))
!=
hash
(
&
(
val
as
usize
)));
assert_eq!
(
hash
(
&
(
val
as
u32
)),
hash
(
&
(
val
as
usize
)));
}
#[test]
#[test]
fn
test_hash_idempotent
()
{
fn
test_hash_idempotent
()
{
...
...
src/libstd/sys/unix/condvar.rs
浏览文件 @
e57ee3d0
...
@@ -92,14 +92,15 @@ pub unsafe fn wait_timeout(&self, mutex: &Mutex, dur: Duration) -> bool {
...
@@ -92,14 +92,15 @@ pub unsafe fn wait_timeout(&self, mutex: &Mutex, dur: Duration) -> bool {
assert_eq!
(
r
,
0
);
assert_eq!
(
r
,
0
);
// Nanosecond calculations can't overflow because both values are below 1e9.
// Nanosecond calculations can't overflow because both values are below 1e9.
let
nsec
=
dur
.subsec_nanos
()
as
libc
::
c_long
+
now
.tv_nsec
as
libc
::
c_long
;
let
nsec
=
dur
.subsec_nanos
()
+
now
.tv_nsec
as
u32
;
let
sec
=
saturating_cast_to_time_t
(
dur
.as_secs
())
let
sec
=
saturating_cast_to_time_t
(
dur
.as_secs
())
.checked_add
((
nsec
/
1_000_000_000
)
as
libc
::
time_t
)
.checked_add
((
nsec
/
1_000_000_000
)
as
libc
::
time_t
)
.and_then
(|
s
|
s
.checked_add
(
now
.tv_sec
));
.and_then
(|
s
|
s
.checked_add
(
now
.tv_sec
));
let
nsec
=
nsec
%
1_000_000_000
;
let
nsec
=
nsec
%
1_000_000_000
;
let
timeout
=
sec
.map
(|
s
|
{
let
timeout
=
sec
.map
(|
s
|
{
libc
::
timespec
{
tv_sec
:
s
,
tv_nsec
:
nsec
}
libc
::
timespec
{
tv_sec
:
s
,
tv_nsec
:
nsec
as
_
}
})
.unwrap_or
(
TIMESPEC_MAX
);
})
.unwrap_or
(
TIMESPEC_MAX
);
let
r
=
libc
::
pthread_cond_timedwait
(
self
.inner
.get
(),
mutex
::
raw
(
mutex
),
let
r
=
libc
::
pthread_cond_timedwait
(
self
.inner
.get
(),
mutex
::
raw
(
mutex
),
...
...
src/libstd/sys/unix/fs.rs
浏览文件 @
e57ee3d0
...
@@ -132,14 +132,14 @@ impl FileAttr {
...
@@ -132,14 +132,14 @@ impl FileAttr {
pub
fn
modified
(
&
self
)
->
io
::
Result
<
SystemTime
>
{
pub
fn
modified
(
&
self
)
->
io
::
Result
<
SystemTime
>
{
Ok
(
SystemTime
::
from
(
libc
::
timespec
{
Ok
(
SystemTime
::
from
(
libc
::
timespec
{
tv_sec
:
self
.stat.st_mtime
as
libc
::
time_t
,
tv_sec
:
self
.stat.st_mtime
as
libc
::
time_t
,
tv_nsec
:
self
.stat.st_mtime_nsec
as
libc
::
c_long
,
tv_nsec
:
self
.stat.st_mtime_nsec
as
_
,
}))
}))
}
}
pub
fn
accessed
(
&
self
)
->
io
::
Result
<
SystemTime
>
{
pub
fn
accessed
(
&
self
)
->
io
::
Result
<
SystemTime
>
{
Ok
(
SystemTime
::
from
(
libc
::
timespec
{
Ok
(
SystemTime
::
from
(
libc
::
timespec
{
tv_sec
:
self
.stat.st_atime
as
libc
::
time_t
,
tv_sec
:
self
.stat.st_atime
as
libc
::
time_t
,
tv_nsec
:
self
.stat.st_atime_nsec
as
libc
::
c_long
,
tv_nsec
:
self
.stat.st_atime_nsec
as
_
,
}))
}))
}
}
...
...
src/libstd/sys/unix/thread.rs
浏览文件 @
e57ee3d0
...
@@ -149,7 +149,7 @@ pub fn set_name(_name: &CStr) {
...
@@ -149,7 +149,7 @@ pub fn set_name(_name: &CStr) {
pub
fn
sleep
(
dur
:
Duration
)
{
pub
fn
sleep
(
dur
:
Duration
)
{
let
mut
secs
=
dur
.as_secs
();
let
mut
secs
=
dur
.as_secs
();
let
mut
nsecs
=
dur
.subsec_nanos
()
as
libc
::
c_long
;
let
mut
nsecs
=
dur
.subsec_nanos
()
as
_
;
// If we're awoken with a signal then the return value will be -1 and
// If we're awoken with a signal then the return value will be -1 and
// nanosleep will fill in `ts` with the remaining time.
// nanosleep will fill in `ts` with the remaining time.
...
...
src/libstd/sys/unix/time.rs
浏览文件 @
e57ee3d0
...
@@ -60,7 +60,7 @@ fn add_duration(&self, other: &Duration) -> Timespec {
...
@@ -60,7 +60,7 @@ fn add_duration(&self, other: &Duration) -> Timespec {
Timespec
{
Timespec
{
t
:
libc
::
timespec
{
t
:
libc
::
timespec
{
tv_sec
:
secs
,
tv_sec
:
secs
,
tv_nsec
:
nsec
as
libc
::
c_long
,
tv_nsec
:
nsec
as
_
,
},
},
}
}
}
}
...
@@ -83,7 +83,7 @@ fn sub_duration(&self, other: &Duration) -> Timespec {
...
@@ -83,7 +83,7 @@ fn sub_duration(&self, other: &Duration) -> Timespec {
Timespec
{
Timespec
{
t
:
libc
::
timespec
{
t
:
libc
::
timespec
{
tv_sec
:
secs
,
tv_sec
:
secs
,
tv_nsec
:
nsec
as
libc
::
c_long
,
tv_nsec
:
nsec
as
_
,
},
},
}
}
}
}
...
...
src/test/codegen/issue-37945.rs
浏览文件 @
e57ee3d0
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
// ignore-x86
// ignore-x86
// ignore-arm
// ignore-arm
// ignore-emscripten
// ignore-emscripten
// ignore-gnux32
// ignore 32-bit platforms (LLVM has a bug with them)
// ignore 32-bit platforms (LLVM has a bug with them)
// See issue #37945.
// See issue #37945.
...
...
src/tools/compiletest/src/util.rs
浏览文件 @
e57ee3d0
...
@@ -73,7 +73,7 @@ pub fn get_env(triple: &str) -> Option<&str> {
...
@@ -73,7 +73,7 @@ pub fn get_env(triple: &str) -> Option<&str> {
}
}
pub
fn
get_pointer_width
(
triple
:
&
str
)
->
&
'static
str
{
pub
fn
get_pointer_width
(
triple
:
&
str
)
->
&
'static
str
{
if
triple
.contains
(
"64"
)
||
triple
.starts_with
(
"s390x"
)
{
if
(
triple
.contains
(
"64"
)
&&
!
triple
.ends_with
(
"gnux32"
)
)
||
triple
.starts_with
(
"s390x"
)
{
"64bit"
"64bit"
}
else
{
}
else
{
"32bit"
"32bit"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录