Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
94d04e68
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,发现更多精彩内容 >>
提交
94d04e68
编写于
1月 26, 2015
作者:
J
Jorge Aparicio
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix inference fallout
上级
efc97a51
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
28 addition
and
28 deletion
+28
-28
src/libcollections/bit.rs
src/libcollections/bit.rs
+2
-2
src/libcollections/ring_buf.rs
src/libcollections/ring_buf.rs
+4
-4
src/libcollections/slice.rs
src/libcollections/slice.rs
+9
-9
src/librbml/lib.rs
src/librbml/lib.rs
+4
-4
src/libstd/collections/hash/map.rs
src/libstd/collections/hash/map.rs
+4
-4
src/libstd/collections/hash/set.rs
src/libstd/collections/hash/set.rs
+2
-2
src/libtest/stats.rs
src/libtest/stats.rs
+1
-1
src/test/run-pass/issue-15673.rs
src/test/run-pass/issue-15673.rs
+1
-1
src/test/run-pass/issue-2989.rs
src/test/run-pass/issue-2989.rs
+1
-1
未找到文件。
src/libcollections/bit.rs
浏览文件 @
94d04e68
...
...
@@ -66,7 +66,7 @@
//! };
//!
//! // Simple primality tests below our max bound
//! let print_primes = 20;
//! let print_primes = 20
u
;
//! print!("The primes below {} are: ", print_primes);
//! for x in 0..print_primes {
//! if primes.contains(&x) {
...
...
@@ -2283,7 +2283,7 @@ fn test_bitv_iterator() {
assert_eq!
(
bitv
.iter
()
.collect
::
<
Vec
<
bool
>>
(),
bools
);
let
long
=
(
0
..
10000
)
.map
(|
i
|
i
%
2
==
0
)
.collect
::
<
Vec
<
_
>>
();
let
long
=
(
0
i32
..
10000
)
.map
(|
i
|
i
%
2
==
0
)
.collect
::
<
Vec
<
_
>>
();
let
bitv
:
Bitv
=
long
.iter
()
.map
(|
n
|
*
n
)
.collect
();
assert_eq!
(
bitv
.iter
()
.collect
::
<
Vec
<
bool
>>
(),
long
)
}
...
...
src/libcollections/ring_buf.rs
浏览文件 @
94d04e68
...
...
@@ -2126,7 +2126,7 @@ fn test_into_iter() {
for
i
in
0
i
..
5
{
d
.push_back
(
i
);
}
for
i
in
6
..
9
{
for
i
in
6
i
..
9
{
d
.push_front
(
i
);
}
...
...
@@ -2140,7 +2140,7 @@ fn test_into_iter() {
for
i
in
0
i
..
5
{
d
.push_back
(
i
);
}
for
i
in
6
..
9
{
for
i
in
6
i
..
9
{
d
.push_front
(
i
);
}
...
...
@@ -2190,7 +2190,7 @@ fn test_drain() {
for
i
in
0
i
..
5
{
d
.push_back
(
i
);
}
for
i
in
6
..
9
{
for
i
in
6
i
..
9
{
d
.push_front
(
i
);
}
...
...
@@ -2204,7 +2204,7 @@ fn test_drain() {
for
i
in
0
i
..
5
{
d
.push_back
(
i
);
}
for
i
in
6
..
9
{
for
i
in
6
i
..
9
{
d
.push_front
(
i
);
}
...
...
src/libcollections/slice.rs
浏览文件 @
94d04e68
...
...
@@ -1526,7 +1526,7 @@ fn is_odd(n: &uint) -> bool { *n % 2u == 1u }
#[test]
fn
test_from_fn
()
{
// Test on-stack from_fn.
let
mut
v
=
(
0
..
3
)
.map
(
square
)
.collect
::
<
Vec
<
_
>>
();
let
mut
v
=
(
0
u
..
3
)
.map
(
square
)
.collect
::
<
Vec
<
_
>>
();
{
let
v
=
v
.as_slice
();
assert_eq!
(
v
.len
(),
3u
);
...
...
@@ -1536,7 +1536,7 @@ fn test_from_fn() {
}
// Test on-heap from_fn.
v
=
(
0
..
5
)
.map
(
square
)
.collect
::
<
Vec
<
_
>>
();
v
=
(
0
u
..
5
)
.map
(
square
)
.collect
::
<
Vec
<
_
>>
();
{
let
v
=
v
.as_slice
();
assert_eq!
(
v
.len
(),
5u
);
...
...
@@ -2908,7 +2908,7 @@ fn push(b: &mut Bencher) {
#[bench]
fn
starts_with_same_vector
(
b
:
&
mut
Bencher
)
{
let
vec
:
Vec
<
uint
>
=
(
0
..
100
)
.collect
();
let
vec
:
Vec
<
uint
>
=
(
0
u
..
100
)
.collect
();
b
.iter
(||
{
vec
.starts_with
(
vec
.as_slice
())
})
...
...
@@ -2924,8 +2924,8 @@ fn starts_with_single_element(b: &mut Bencher) {
#[bench]
fn
starts_with_diff_one_element_at_end
(
b
:
&
mut
Bencher
)
{
let
vec
:
Vec
<
uint
>
=
(
0
..
100
)
.collect
();
let
mut
match_vec
:
Vec
<
uint
>
=
(
0
..
99
)
.collect
();
let
vec
:
Vec
<
uint
>
=
(
0
u
..
100
)
.collect
();
let
mut
match_vec
:
Vec
<
uint
>
=
(
0
u
..
99
)
.collect
();
match_vec
.push
(
0
);
b
.iter
(||
{
vec
.starts_with
(
match_vec
.as_slice
())
...
...
@@ -2934,7 +2934,7 @@ fn starts_with_diff_one_element_at_end(b: &mut Bencher) {
#[bench]
fn
ends_with_same_vector
(
b
:
&
mut
Bencher
)
{
let
vec
:
Vec
<
uint
>
=
(
0
..
100
)
.collect
();
let
vec
:
Vec
<
uint
>
=
(
0
u
..
100
)
.collect
();
b
.iter
(||
{
vec
.ends_with
(
vec
.as_slice
())
})
...
...
@@ -2950,8 +2950,8 @@ fn ends_with_single_element(b: &mut Bencher) {
#[bench]
fn
ends_with_diff_one_element_at_beginning
(
b
:
&
mut
Bencher
)
{
let
vec
:
Vec
<
uint
>
=
(
0
..
100
)
.collect
();
let
mut
match_vec
:
Vec
<
uint
>
=
(
0
..
100
)
.collect
();
let
vec
:
Vec
<
uint
>
=
(
0
u
..
100
)
.collect
();
let
mut
match_vec
:
Vec
<
uint
>
=
(
0
u
..
100
)
.collect
();
match_vec
.as_mut_slice
()[
0
]
=
200
;
b
.iter
(||
{
vec
.starts_with
(
match_vec
.as_slice
())
...
...
@@ -2960,7 +2960,7 @@ fn ends_with_diff_one_element_at_beginning(b: &mut Bencher) {
#[bench]
fn
contains_last_element
(
b
:
&
mut
Bencher
)
{
let
vec
:
Vec
<
uint
>
=
(
0
..
100
)
.collect
();
let
vec
:
Vec
<
uint
>
=
(
0
u
..
100
)
.collect
();
b
.iter
(||
{
vec
.contains
(
&
99u
)
})
...
...
src/librbml/lib.rs
浏览文件 @
94d04e68
...
...
@@ -1184,7 +1184,7 @@ mod bench {
#[bench]
pub
fn
vuint_at_A_aligned
(
b
:
&
mut
Bencher
)
{
let
data
=
(
0
..
4
*
100
)
.map
(|
i
|
{
let
data
=
(
0
i32
..
4
*
100
)
.map
(|
i
|
{
match
i
%
2
{
0
=>
0x80u8
,
_
=>
i
as
u8
,
...
...
@@ -1202,7 +1202,7 @@ pub fn vuint_at_A_aligned(b: &mut Bencher) {
#[bench]
pub
fn
vuint_at_A_unaligned
(
b
:
&
mut
Bencher
)
{
let
data
=
(
0
..
4
*
100
+
1
)
.map
(|
i
|
{
let
data
=
(
0
i32
..
4
*
100
+
1
)
.map
(|
i
|
{
match
i
%
2
{
1
=>
0x80u8
,
_
=>
i
as
u8
...
...
@@ -1220,7 +1220,7 @@ pub fn vuint_at_A_unaligned(b: &mut Bencher) {
#[bench]
pub
fn
vuint_at_D_aligned
(
b
:
&
mut
Bencher
)
{
let
data
=
(
0
..
4
*
100
)
.map
(|
i
|
{
let
data
=
(
0
i32
..
4
*
100
)
.map
(|
i
|
{
match
i
%
4
{
0
=>
0x10u8
,
3
=>
i
as
u8
,
...
...
@@ -1239,7 +1239,7 @@ pub fn vuint_at_D_aligned(b: &mut Bencher) {
#[bench]
pub
fn
vuint_at_D_unaligned
(
b
:
&
mut
Bencher
)
{
let
data
=
(
0
..
4
*
100
+
1
)
.map
(|
i
|
{
let
data
=
(
0
i32
..
4
*
100
+
1
)
.map
(|
i
|
{
match
i
%
4
{
1
=>
0x10u8
,
0
=>
i
as
u8
,
...
...
src/libstd/collections/hash/map.rs
浏览文件 @
94d04e68
...
...
@@ -2094,18 +2094,18 @@ fn test_reserve_shrink_to_fit() {
m
.insert
(
0u
,
0u
);
m
.remove
(
&
0
);
assert
!
(
m
.capacity
()
>=
m
.len
());
for
i
in
0
..
128
{
for
i
in
0
u
s
..
128
{
m
.insert
(
i
,
i
);
}
m
.reserve
(
256
);
let
usable_cap
=
m
.capacity
();
for
i
in
128
..
128
+
256
{
for
i
in
128
u
s
..
128
+
256
{
m
.insert
(
i
,
i
);
assert_eq!
(
m
.capacity
(),
usable_cap
);
}
for
i
in
100
..
128
+
256
{
for
i
in
100
u
s
..
128
+
256
{
assert_eq!
(
m
.remove
(
&
i
),
Some
(
i
));
}
m
.shrink_to_fit
();
...
...
@@ -2114,7 +2114,7 @@ fn test_reserve_shrink_to_fit() {
assert
!
(
!
m
.is_empty
());
assert
!
(
m
.capacity
()
>=
m
.len
());
for
i
in
0
..
100
{
for
i
in
0
u
s
..
100
{
assert_eq!
(
m
.remove
(
&
i
),
Some
(
i
));
}
m
.shrink_to_fit
();
...
...
src/libstd/collections/hash/set.rs
浏览文件 @
94d04e68
...
...
@@ -1198,7 +1198,7 @@ fn test_trivial_drain() {
#[test]
fn
test_drain
()
{
let
mut
s
:
HashSet
<
int
>
=
(
1
..
100
)
.collect
();
let
mut
s
:
HashSet
<
int
>
=
(
1
is
..
100
)
.collect
();
// try this a bunch of times to make sure we don't screw up internal state.
for
_
in
0
i
..
20
{
...
...
@@ -1217,7 +1217,7 @@ fn test_drain() {
for
_
in
s
.iter
()
{
panic!
(
"s should be empty!"
);
}
// reset to try again.
s
.extend
(
1
..
100
);
s
.extend
(
1
is
..
100
);
}
}
}
src/libtest/stats.rs
浏览文件 @
94d04e68
...
...
@@ -939,7 +939,7 @@ pub fn sum_three_items(b: &mut Bencher) {
#[bench]
pub
fn
sum_many_f64
(
b
:
&
mut
Bencher
)
{
let
nums
=
[
-
1e30f64
,
1e60
,
1e30
,
1.0
,
-
1e60
];
let
v
=
(
0
..
500
)
.map
(|
i
|
nums
[
i
%
5
])
.collect
::
<
Vec
<
_
>>
();
let
v
=
(
0
u
s
..
500
)
.map
(|
i
|
nums
[
i
%
5
])
.collect
::
<
Vec
<
_
>>
();
b
.iter
(||
{
v
.sum
();
...
...
src/test/run-pass/issue-15673.rs
浏览文件 @
94d04e68
...
...
@@ -11,5 +11,5 @@
use
std
::
iter
::
AdditiveIterator
;
fn
main
()
{
let
x
:
[
u64
;
3
]
=
[
1
,
2
,
3
];
assert_eq!
(
6
,
(
0
..
3
)
.map
(|
i
|
x
[
i
])
.sum
());
assert_eq!
(
6
,
(
0
u
s
..
3
)
.map
(|
i
|
x
[
i
])
.sum
());
}
src/test/run-pass/issue-2989.rs
浏览文件 @
94d04e68
...
...
@@ -21,7 +21,7 @@ fn to_bytes(&self) -> Vec<u8> {
// the position of this function is significant! - if it comes before methods
// then it works, if it comes after it then it doesn't!
fn
to_bools
(
bitv
:
Storage
)
->
Vec
<
bool
>
{
(
0
..
8
)
.map
(|
i
|
{
(
0
u
s
..
8
)
.map
(|
i
|
{
let
w
=
i
/
64
;
let
b
=
i
%
64
;
let
x
=
1u64
&
(
bitv
.storage
[
w
]
>>
b
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录