Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
e72ad98e
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
e72ad98e
编写于
1月 09, 2015
作者:
B
bors
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #20718 from tshepang/bench-fix-some-warnings
bench: fix a few compiler warnings Reviewed-by: alexcrichton
上级
44a287e6
0f4ee2d8
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
14 addition
and
43 deletion
+14
-43
src/test/bench/core-map.rs
src/test/bench/core-map.rs
+0
-1
src/test/bench/core-set.rs
src/test/bench/core-set.rs
+0
-1
src/test/bench/core-uint-to-str.rs
src/test/bench/core-uint-to-str.rs
+0
-1
src/test/bench/msgsend-pipes-shared.rs
src/test/bench/msgsend-pipes-shared.rs
+0
-1
src/test/bench/msgsend-pipes.rs
src/test/bench/msgsend-pipes.rs
+1
-4
src/test/bench/msgsend-ring-mutex-arcs.rs
src/test/bench/msgsend-ring-mutex-arcs.rs
+1
-2
src/test/bench/rt-parfib.rs
src/test/bench/rt-parfib.rs
+3
-4
src/test/bench/shootout-binarytrees.rs
src/test/bench/shootout-binarytrees.rs
+1
-1
src/test/bench/shootout-chameneos-redux.rs
src/test/bench/shootout-chameneos-redux.rs
+1
-1
src/test/bench/shootout-fannkuch-redux.rs
src/test/bench/shootout-fannkuch-redux.rs
+2
-2
src/test/bench/shootout-k-nucleotide.rs
src/test/bench/shootout-k-nucleotide.rs
+0
-1
src/test/bench/shootout-nbody.rs
src/test/bench/shootout-nbody.rs
+1
-1
src/test/bench/shootout-reverse-complement.rs
src/test/bench/shootout-reverse-complement.rs
+1
-1
src/test/bench/shootout-threadring.rs
src/test/bench/shootout-threadring.rs
+2
-2
src/test/bench/std-smallintmap.rs
src/test/bench/std-smallintmap.rs
+0
-1
src/test/bench/sudoku.rs
src/test/bench/sudoku.rs
+1
-13
src/test/bench/task-perf-alloc-unwind.rs
src/test/bench/task-perf-alloc-unwind.rs
+0
-4
src/test/bench/task-perf-jargon-metal-smoke.rs
src/test/bench/task-perf-jargon-metal-smoke.rs
+0
-1
src/test/bench/task-perf-spawnalot.rs
src/test/bench/task-perf-spawnalot.rs
+0
-1
未找到文件。
src/test/bench/core-map.rs
浏览文件 @
e72ad98e
...
...
@@ -14,7 +14,6 @@
use
std
::
os
;
use
std
::
rand
::{
Rng
,
IsaacRng
,
SeedableRng
};
use
std
::
time
::
Duration
;
use
std
::
uint
;
fn
timed
<
F
>
(
label
:
&
str
,
f
:
F
)
where
F
:
FnMut
()
{
println!
(
" {}: {}"
,
label
,
Duration
::
span
(
f
));
...
...
src/test/bench/core-set.rs
浏览文件 @
e72ad98e
...
...
@@ -22,7 +22,6 @@
use
std
::
hash
::
Hash
;
use
std
::
os
;
use
std
::
time
::
Duration
;
use
std
::
uint
;
struct
Results
{
sequential_ints
:
Duration
,
...
...
src/test/bench/core-uint-to-str.rs
浏览文件 @
e72ad98e
...
...
@@ -9,7 +9,6 @@
// except according to those terms.
use
std
::
os
;
use
std
::
uint
;
fn
main
()
{
let
args
=
os
::
args
();
...
...
src/test/bench/msgsend-pipes-shared.rs
浏览文件 @
e72ad98e
...
...
@@ -22,7 +22,6 @@
use
std
::
os
;
use
std
::
thread
::
Thread
;
use
std
::
time
::
Duration
;
use
std
::
uint
;
fn
move_out
<
T
>
(
_
x
:
T
)
{}
...
...
src/test/bench/msgsend-pipes.rs
浏览文件 @
e72ad98e
...
...
@@ -18,9 +18,6 @@
use
std
::
os
;
use
std
::
thread
::
Thread
;
use
std
::
time
::
Duration
;
use
std
::
uint
;
fn
move_out
<
T
>
(
_
x
:
T
)
{}
enum
request
{
get_count
,
...
...
@@ -42,7 +39,7 @@ fn server(requests: &Receiver<request>, responses: &Sender<uint>) {
_
=>
{
}
}
}
responses
.send
(
count
);
responses
.send
(
count
)
.unwrap
()
;
//println!("server exiting");
}
...
...
src/test/bench/msgsend-ring-mutex-arcs.rs
浏览文件 @
e72ad98e
...
...
@@ -21,7 +21,6 @@
use
std
::
os
;
use
std
::
sync
::{
Arc
,
Future
,
Mutex
,
Condvar
};
use
std
::
time
::
Duration
;
use
std
::
uint
;
// A poor man's pipe.
type
pipe
=
Arc
<
(
Mutex
<
Vec
<
uint
>>
,
Condvar
)
>
;
...
...
@@ -76,7 +75,7 @@ fn main() {
let
num_tasks
=
args
[
1
]
.parse
::
<
uint
>
()
.unwrap
();
let
msg_per_task
=
args
[
2
]
.parse
::
<
uint
>
()
.unwrap
();
let
(
mut
num_chan
,
num_port
)
=
init
();
let
(
num_chan
,
num_port
)
=
init
();
let
mut
p
=
Some
((
num_chan
,
num_port
));
let
dur
=
Duration
::
span
(||
{
...
...
src/test/bench/rt-parfib.rs
浏览文件 @
e72ad98e
...
...
@@ -11,23 +11,22 @@
use
std
::
sync
::
mpsc
::
channel
;
use
std
::
os
;
use
std
::
thread
::
Thread
;
use
std
::
uint
;
// A simple implementation of parfib. One subtree is found in a new
// task and communicated over a oneshot pipe, the other is found
// locally. There is no sequential-mode threshold.
fn
parfib
(
n
:
uint
)
->
uint
{
if
(
n
==
0
||
n
==
1
)
{
if
n
==
0
||
n
==
1
{
return
1
;
}
let
(
tx
,
rx
)
=
channel
();
Thread
::
spawn
(
move
||
{
tx
.send
(
parfib
(
n
-
1
));
tx
.send
(
parfib
(
n
-
1
))
.unwrap
()
;
});
let
m2
=
parfib
(
n
-
2
);
return
(
rx
.recv
()
.unwrap
()
+
m2
)
;
return
rx
.recv
()
.unwrap
()
+
m2
;
}
fn
main
()
{
...
...
src/test/bench/shootout-binarytrees.rs
浏览文件 @
e72ad98e
...
...
@@ -92,7 +92,7 @@ fn main() {
let
long_lived_arena
=
TypedArena
::
new
();
let
long_lived_tree
=
bottom_up_tree
(
&
long_lived_arena
,
0
,
max_depth
);
let
m
ut
m
essages
=
range_step
(
min_depth
,
max_depth
+
1
,
2
)
.map
(|
depth
|
{
let
messages
=
range_step
(
min_depth
,
max_depth
+
1
,
2
)
.map
(|
depth
|
{
use
std
::
num
::
Int
;
let
iterations
=
2
i
.pow
((
max_depth
-
depth
+
min_depth
)
as
uint
);
Thread
::
scoped
(
move
||
{
...
...
src/test/bench/shootout-chameneos-redux.rs
浏览文件 @
e72ad98e
...
...
@@ -182,7 +182,7 @@ fn rendezvous(nn: uint, set: Vec<Color>) {
let
(
to_rendezvous_log
,
from_creatures_log
)
=
channel
::
<
String
>
();
// these channels will allow us to talk to each creature by 'name'/index
let
mut
to_creature
:
Vec
<
Sender
<
CreatureInfo
>>
=
let
to_creature
:
Vec
<
Sender
<
CreatureInfo
>>
=
set
.iter
()
.enumerate
()
.map
(|(
ii
,
&
col
)|
{
// create each creature as a listener with a port, and
// give us a channel to talk to each
...
...
src/test/bench/shootout-fannkuch-redux.rs
浏览文件 @
e72ad98e
...
...
@@ -128,7 +128,7 @@ fn next(&mut self) -> P {
}
fn
reverse
(
tperm
:
&
mut
[
i32
],
mut
k
:
uint
)
{
fn
reverse
(
tperm
:
&
mut
[
i32
],
k
:
uint
)
{
tperm
.slice_to_mut
(
k
)
.reverse
()
}
...
...
@@ -163,7 +163,7 @@ fn fannkuch(n: i32) -> (i32, i32) {
let
mut
futures
=
vec!
[];
let
k
=
perm
.max
()
/
N
;
for
(
i
,
j
)
in
range
(
0
,
N
)
.zip
(
iter
::
count
(
0
,
k
))
{
for
(
_
,
j
)
in
range
(
0
,
N
)
.zip
(
iter
::
count
(
0
,
k
))
{
let
max
=
cmp
::
min
(
j
+
k
,
perm
.max
());
futures
.push
(
Thread
::
scoped
(
move
||
{
...
...
src/test/bench/shootout-k-nucleotide.rs
浏览文件 @
e72ad98e
...
...
@@ -43,7 +43,6 @@
#![feature(box_syntax)]
use
std
::
ascii
::
OwnedAsciiExt
;
use
std
::
iter
::
repeat
;
use
std
::
slice
;
use
std
::
sync
::
Arc
;
use
std
::
thread
::
Thread
;
...
...
src/test/bench/shootout-nbody.rs
浏览文件 @
e72ad98e
...
...
@@ -202,6 +202,6 @@ fn shift_mut_ref<'a, T>(r: &mut &'a mut [T]) -> Option<&'a mut T> {
raw
.data
=
raw
.data
.offset
(
1
);
raw
.len
-=
1
;
*
r
=
mem
::
transmute
(
raw
);
Some
(
unsafe
{
&
mut
*
ret
})
Some
({
&
mut
*
ret
})
}
}
src/test/bench/shootout-reverse-complement.rs
浏览文件 @
e72ad98e
...
...
@@ -229,7 +229,7 @@ unsafe impl<T: 'static> Send for Racy<T> {}
/// Executes a closure in parallel over the given iterator over mutable slice.
/// The closure `f` is run in parallel with an element of `iter`.
fn
parallel
<
'a
,
I
,
T
,
F
>
(
mut
iter
:
I
,
f
:
F
)
fn
parallel
<
'a
,
I
,
T
,
F
>
(
iter
:
I
,
f
:
F
)
where
T
:
'a
+
Send
+
Sync
,
I
:
Iterator
<
Item
=&
'a
mut
[
T
]
>
,
F
:
Fn
(
&
mut
[
T
])
+
Sync
{
...
...
src/test/bench/shootout-threadring.rs
浏览文件 @
e72ad98e
...
...
@@ -43,7 +43,7 @@
fn
start
(
n_tasks
:
int
,
token
:
int
)
{
let
(
tx
,
mut
rx
)
=
channel
();
tx
.send
(
token
);
tx
.send
(
token
)
.unwrap
()
;
for
i
in
range
(
2
,
n_tasks
+
1
)
{
let
(
tx
,
next_rx
)
=
channel
();
Thread
::
spawn
(
move
||
roundtrip
(
i
,
tx
,
rx
));
...
...
@@ -58,7 +58,7 @@ fn roundtrip(id: int, tx: Sender<int>, rx: Receiver<int>) {
println!
(
"{}"
,
id
);
break
;
}
tx
.send
(
token
-
1
);
tx
.send
(
token
-
1
)
.unwrap
()
;
}
}
...
...
src/test/bench/std-smallintmap.rs
浏览文件 @
e72ad98e
...
...
@@ -13,7 +13,6 @@
use
std
::
collections
::
VecMap
;
use
std
::
os
;
use
std
::
time
::
Duration
;
use
std
::
uint
;
fn
append_sequential
(
min
:
uint
,
max
:
uint
,
map
:
&
mut
VecMap
<
uint
>
)
{
for
i
in
range
(
min
,
max
)
{
...
...
src/test/bench/sudoku.rs
浏览文件 @
e72ad98e
...
...
@@ -55,18 +55,6 @@ pub fn new(g: grid) -> Sudoku {
return
Sudoku
::
new
(
g
)
}
pub
fn
equal
(
&
self
,
other
:
&
Sudoku
)
->
bool
{
for
row
in
range
(
0u8
,
9u8
)
{
for
col
in
range
(
0u8
,
9u8
)
{
if
self
.grid
[
row
as
uint
][
col
as
uint
]
!=
other
.grid
[
row
as
uint
][
col
as
uint
]
{
return
false
;
}
}
}
return
true
;
}
pub
fn
read
(
mut
reader
:
&
mut
BufferedReader
<
StdReader
>
)
->
Sudoku
{
/* assert first line is exactly "9,9" */
assert
!
(
reader
.read_line
()
.unwrap
()
==
"9,9"
.to_string
());
...
...
@@ -184,7 +172,7 @@ fn new(start_color: u8) -> Colors {
fn
next
(
&
self
)
->
u8
{
let
Colors
(
c
)
=
*
self
;
let
val
=
c
&
HEADS
;
if
(
0u16
==
val
)
{
if
0u16
==
val
{
return
0u8
;
}
else
{
return
val
.trailing_zeros
()
as
u8
...
...
src/test/bench/task-perf-alloc-unwind.rs
浏览文件 @
e72ad98e
...
...
@@ -19,10 +19,6 @@ enum List<T> {
Nil
,
Cons
(
T
,
Box
<
List
<
T
>>
)
}
enum
UniqueList
{
ULNil
,
ULCons
(
Box
<
UniqueList
>
)
}
fn
main
()
{
let
(
repeat
,
depth
)
=
if
os
::
getenv
(
"RUST_BENCH"
)
.is_some
()
{
(
50
,
1000
)
...
...
src/test/bench/task-perf-jargon-metal-smoke.rs
浏览文件 @
e72ad98e
...
...
@@ -20,7 +20,6 @@
use
std
::
sync
::
mpsc
::{
channel
,
Sender
};
use
std
::
os
;
use
std
::
thread
::
Thread
;
use
std
::
uint
;
fn
child_generation
(
gens_left
:
uint
,
tx
:
Sender
<
()
>
)
{
// This used to be O(n^2) in the number of generations that ever existed.
...
...
src/test/bench/task-perf-spawnalot.rs
浏览文件 @
e72ad98e
...
...
@@ -9,7 +9,6 @@
// except according to those terms.
use
std
::
os
;
use
std
::
uint
;
use
std
::
thread
::
Thread
;
fn
f
(
n
:
uint
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录