Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
b53057f4
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,发现更多精彩内容 >>
提交
b53057f4
编写于
3月 23, 2013
作者:
A
Alex Crichton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: Remove uses of oldmap::HashMap
上级
17459d0b
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
88 addition
and
116 deletion
+88
-116
src/test/auxiliary/issue-2631-a.rs
src/test/auxiliary/issue-2631-a.rs
+4
-4
src/test/bench/core-std.rs
src/test/bench/core-std.rs
+0
-20
src/test/bench/graph500-bfs.rs
src/test/bench/graph500-bfs.rs
+18
-12
src/test/bench/shootout-chameneos-redux.rs
src/test/bench/shootout-chameneos-redux.rs
+0
-2
src/test/bench/shootout-k-nucleotide-pipes.rs
src/test/bench/shootout-k-nucleotide-pipes.rs
+20
-17
src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs
src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs
+4
-4
src/test/compile-fail/for-loop-decl.rs
src/test/compile-fail/for-loop-decl.rs
+3
-3
src/test/run-pass/extern-mod-syntax.rs
src/test/run-pass/extern-mod-syntax.rs
+1
-1
src/test/run-pass/hashmap-memory.rs
src/test/run-pass/hashmap-memory.rs
+17
-27
src/test/run-pass/issue-1696.rs
src/test/run-pass/issue-1696.rs
+2
-3
src/test/run-pass/issue-2631-b.rs
src/test/run-pass/issue-2631-b.rs
+3
-4
src/test/run-pass/issue-2804-2.rs
src/test/run-pass/issue-2804-2.rs
+4
-4
src/test/run-pass/issue-2804.rs
src/test/run-pass/issue-2804.rs
+7
-7
src/test/run-pass/issue-3026.rs
src/test/run-pass/issue-3026.rs
+2
-4
src/test/run-pass/issue-3559.rs
src/test/run-pass/issue-3559.rs
+1
-2
src/test/run-pass/issue-4092.rs
src/test/run-pass/issue-4092.rs
+2
-2
未找到文件。
src/test/auxiliary/issue-2631-a.rs
浏览文件 @
b53057f4
...
...
@@ -13,11 +13,11 @@
extern
mod
std
;
use
std
::
oldmap
::
Hash
Map
;
use
core
::
hashmap
::
linear
::
Linear
Map
;
pub
type
header_map
=
Hash
Map
<~
str
,
@
mut
~
[
@~
str
]
>
;
pub
type
header_map
=
Linear
Map
<~
str
,
@
mut
~
[
@~
str
]
>
;
// the unused ty param is necessary so this gets monomorphized
pub
fn
request
<
T
:
Copy
>
(
req
:
header_map
)
{
let
_
x
=
copy
*
(
copy
*
req
.get
(
&~
"METHOD"
))[
0u
];
pub
fn
request
<
T
:
Copy
>
(
req
:
&
header_map
)
{
let
_
x
=
copy
*
(
copy
*
*
req
.get
(
&~
"METHOD"
))[
0u
];
}
src/test/bench/core-std.rs
浏览文件 @
b53057f4
...
...
@@ -14,7 +14,6 @@
use
std
::
time
::
precise_time_s
;
use
std
::
oldmap
;
use
std
::
oldmap
::{
Map
,
HashMap
};
use
core
::
io
::{
Reader
,
ReaderUtil
};
use
core
::
rand
::
RngUtil
;
...
...
@@ -29,7 +28,6 @@ fn main() {
bench!
(
shift_push
);
bench!
(
read_line
);
bench!
(
str_set
);
bench!
(
vec_plus
);
bench!
(
vec_append
);
bench!
(
vec_push_all
);
...
...
@@ -73,24 +71,6 @@ fn read_line() {
}
}
fn
str_set
()
{
let
r
=
rand
::
Rng
();
let
s
=
oldmap
::
HashMap
();
for
int
::
range
(
0
,
1000
)
|
_
i
|
{
oldmap
::
set_add
(
s
,
r
.gen_str
(
10
));
}
let
mut
found
=
0
;
for
int
::
range
(
0
,
1000
)
|
_
i
|
{
match
s
.find
(
&
r
.gen_str
(
10
))
{
Some
(
_
)
=>
{
found
+=
1
;
}
None
=>
{
}
}
}
}
fn
vec_plus
()
{
let
r
=
rand
::
Rng
();
...
...
src/test/bench/graph500-bfs.rs
浏览文件 @
b53057f4
...
...
@@ -22,11 +22,9 @@
extern
mod
std
;
use
std
::
arc
;
use
std
::
time
;
use
std
::
oldmap
;
use
std
::
oldmap
::
Map
;
use
std
::
oldmap
::
HashMap
;
use
std
::
deque
::
Deque
;
use
std
::
par
;
use
core
::
hashmap
::
linear
::{
LinearMap
,
LinearSet
};
use
core
::
io
::
WriterUtil
;
use
core
::
int
::
abs
;
use
core
::
rand
::
RngUtil
;
...
...
@@ -82,27 +80,31 @@ fn choose_edge(i: node_id, j: node_id, scale: uint, r: @rand::Rng)
}
fn
make_graph
(
N
:
uint
,
edges
:
~
[(
node_id
,
node_id
)])
->
graph
{
let
graph
=
do
vec
::
from_fn
(
N
)
|
_
i
|
{
oldmap
::
HashMap
::
<
node_id
,
()
>
()
let
mut
graph
=
do
vec
::
from_fn
(
N
)
|
_
i
|
{
LinearSet
::
new
()
};
do
vec
::
each
(
edges
)
|
e
|
{
match
*
e
{
(
i
,
j
)
=>
{
oldmap
::
set_add
(
graph
[
i
],
j
);
oldmap
::
set_add
(
graph
[
j
],
i
);
graph
[
i
]
.insert
(
j
);
graph
[
j
]
.insert
(
i
);
}
}
true
}
do
graph
.map
()
|
v
|
{
oldmap
::
vec_from_set
(
*
v
)
do
vec
::
map_consume
(
graph
)
|
mut
v
|
{
let
mut
vec
=
~
[];
do
v
.consume
|
i
|
{
vec
.push
(
i
);
}
vec
}
}
fn
gen_search_keys
(
graph
:
&
[
~
[
node_id
]],
n
:
uint
)
->
~
[
node_id
]
{
let
keys
=
oldmap
::
HashMap
::
<
node_id
,
()
>
();
let
mut
keys
=
LinearSet
::
new
();
let
r
=
rand
::
Rng
();
while
keys
.len
()
<
n
{
...
...
@@ -111,10 +113,14 @@ fn gen_search_keys(graph: &[~[node_id]], n: uint) -> ~[node_id] {
if
graph
[
k
]
.len
()
>
0u
&&
vec
::
any
(
graph
[
k
],
|
i
|
{
*
i
!=
k
as
node_id
})
{
oldmap
::
set_add
(
keys
,
k
as
node_id
);
keys
.insert
(
k
as
node_id
);
}
}
oldmap
::
vec_from_set
(
keys
)
let
mut
vec
=
~
[];
do
keys
.consume
|
i
|
{
vec
.push
(
i
);
}
return
vec
;
}
/**
...
...
src/test/bench/shootout-chameneos-redux.rs
浏览文件 @
b53057f4
...
...
@@ -11,8 +11,6 @@
// chameneos
extern
mod
std
;
use
std
::
oldmap
;
use
std
::
oldmap
::
HashMap
;
use
std
::
sort
;
use
core
::
cell
::
Cell
;
use
core
::
comm
::
*
;
...
...
src/test/bench/shootout-k-nucleotide-pipes.rs
浏览文件 @
b53057f4
...
...
@@ -14,15 +14,14 @@
#[legacy_modes]
;
extern
mod
std
;
use
std
::
oldmap
;
use
std
::
oldmap
::
HashMap
;
use
std
::
sort
;
use
core
::
hashmap
::
linear
::
LinearMap
;
use
core
::
io
::
ReaderUtil
;
use
core
::
comm
::{
stream
,
Port
,
Chan
};
use
core
::
cmp
::
Ord
;
// given a map, print a sorted version of it
fn
sort_and_fmt
(
mm
:
Hash
Map
<~
[
u8
],
uint
>
,
total
:
uint
)
->
~
str
{
fn
sort_and_fmt
(
mm
:
&
Linear
Map
<~
[
u8
],
uint
>
,
total
:
uint
)
->
~
str
{
fn
pct
(
xx
:
uint
,
yy
:
uint
)
->
float
{
return
(
xx
as
float
)
*
100
f
/
(
yy
as
float
);
}
...
...
@@ -49,7 +48,7 @@ fn sortKV<TT:Copy + Ord,UU:Copy + Ord>(orig: ~[(TT,UU)]) -> ~[(TT,UU)] {
let
mut
pairs
=
~
[];
// map -> [(k,%)]
for
mm
.each
|
&
key
,
&
val
|
{
for
mm
.each
|
&
(
&
key
,
&
val
)
|
{
pairs
.push
((
key
,
pct
(
val
,
total
)));
}
...
...
@@ -68,17 +67,21 @@ fn sortKV<TT:Copy + Ord,UU:Copy + Ord>(orig: ~[(TT,UU)]) -> ~[(TT,UU)] {
}
// given a map, search for the frequency of a pattern
fn
find
(
mm
:
Hash
Map
<~
[
u8
],
uint
>
,
key
:
~
str
)
->
uint
{
fn
find
(
mm
:
&
Linear
Map
<~
[
u8
],
uint
>
,
key
:
~
str
)
->
uint
{
match
mm
.find
(
&
str
::
to_bytes
(
str
::
to_lower
(
key
)))
{
option
::
None
=>
{
return
0u
;
}
option
::
Some
(
num
)
=>
{
return
num
;
}
option
::
Some
(
&
num
)
=>
{
return
num
;
}
}
}
// given a map, increment the counter for a key
fn
update_freq
(
mm
:
Hash
Map
<~
[
u8
],
uint
>
,
key
:
&
[
u8
])
{
fn
update_freq
(
mm
:
&
mut
Linear
Map
<~
[
u8
],
uint
>
,
key
:
&
[
u8
])
{
let
key
=
vec
::
slice
(
key
,
0
,
key
.len
())
.to_vec
();
mm
.update
(
key
,
1
,
|
v
,
v1
|
{
v
+
v1
});
let
newval
=
match
mm
.pop
(
&
key
)
{
Some
(
v
)
=>
v
+
1
,
None
=>
1
};
mm
.insert
(
key
,
newval
);
}
// given a ~[u8], for each window call a function
...
...
@@ -100,7 +103,7 @@ fn windows_with_carry(bb: &[u8], nn: uint,
fn
make_sequence_processor
(
sz
:
uint
,
from_parent
:
comm
::
Port
<~
[
u8
]
>
,
to_parent
:
comm
::
Chan
<~
str
>
)
{
let
freqs
:
HashMap
<~
[
u8
],
uint
>
=
oldmap
::
HashMap
();
let
mut
freqs
:
LinearMap
<~
[
u8
],
uint
>
=
LinearMap
::
new
();
let
mut
carry
:
~
[
u8
]
=
~
[];
let
mut
total
:
uint
=
0u
;
...
...
@@ -112,19 +115,19 @@ fn make_sequence_processor(sz: uint, from_parent: comm::Port<~[u8]>,
if
line
==
~
[]
{
break
;
}
carry
=
windows_with_carry
(
carry
+
line
,
sz
,
|
window
|
{
update_freq
(
freqs
,
window
);
update_freq
(
&
mut
freqs
,
window
);
total
+=
1u
;
});
}
let
buffer
=
match
sz
{
1u
=>
{
sort_and_fmt
(
freqs
,
total
)
}
2u
=>
{
sort_and_fmt
(
freqs
,
total
)
}
3u
=>
{
fmt!
(
"%u
\t
%s"
,
find
(
freqs
,
~
"GGT"
),
~
"GGT"
)
}
4u
=>
{
fmt!
(
"%u
\t
%s"
,
find
(
freqs
,
~
"GGTA"
),
~
"GGTA"
)
}
6u
=>
{
fmt!
(
"%u
\t
%s"
,
find
(
freqs
,
~
"GGTATT"
),
~
"GGTATT"
)
}
12u
=>
{
fmt!
(
"%u
\t
%s"
,
find
(
freqs
,
~
"GGTATTTTAATT"
),
~
"GGTATTTTAATT"
)
}
18u
=>
{
fmt!
(
"%u
\t
%s"
,
find
(
freqs
,
~
"GGTATTTTAATTTATAGT"
),
~
"GGTATTTTAATTTATAGT"
)
}
1u
=>
{
sort_and_fmt
(
&
freqs
,
total
)
}
2u
=>
{
sort_and_fmt
(
&
freqs
,
total
)
}
3u
=>
{
fmt!
(
"%u
\t
%s"
,
find
(
&
freqs
,
~
"GGT"
),
~
"GGT"
)
}
4u
=>
{
fmt!
(
"%u
\t
%s"
,
find
(
&
freqs
,
~
"GGTA"
),
~
"GGTA"
)
}
6u
=>
{
fmt!
(
"%u
\t
%s"
,
find
(
&
freqs
,
~
"GGTATT"
),
~
"GGTATT"
)
}
12u
=>
{
fmt!
(
"%u
\t
%s"
,
find
(
&
freqs
,
~
"GGTATTTTAATT"
),
~
"GGTATTTTAATT"
)
}
18u
=>
{
fmt!
(
"%u
\t
%s"
,
find
(
&
freqs
,
~
"GGTATTTTAATTTATAGT"
),
~
"GGTATTTTAATTTATAGT"
)
}
_
=>
{
~
""
}
};
...
...
src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs
浏览文件 @
b53057f4
...
...
@@ -9,12 +9,12 @@
// except according to those terms.
//buggy.rs
extern
mod
std
;
use
std
::
oldmap
::
Hash
Map
;
use
core
::
hashmap
::
linear
::
Linear
Map
;
fn
main
()
{
let
buggy_map
:
Hash
Map
<
uint
,
&
uint
>
=
HashMap
::
<
uint
,
&
uint
>
();
let
mut
buggy_map
:
Linear
Map
<
uint
,
&
uint
>
=
LinearMap
::
new
::
<
uint
,
&
uint
>
();
buggy_map
.insert
(
42
,
&*~
1
);
//~ ERROR illegal borrow
// but it is ok if we use a temporary
...
...
src/test/compile-fail/for-loop-decl.rs
浏览文件 @
b53057f4
...
...
@@ -10,11 +10,11 @@
// error-pattern: mismatched types
extern
mod
std
;
use
std
::
oldmap
::
HashMap
;
use
std
::
bitv
;
use
core
::
hashmap
::
linear
::
LinearMap
;
struct
FnInfo
{
vars
:
Hash
Map
<
uint
,
VarInfo
>
vars
:
Linear
Map
<
uint
,
VarInfo
>
}
struct
VarInfo
{
...
...
@@ -27,7 +27,7 @@ fn bitv_to_str(enclosing: FnInfo, v: ~bitv::Bitv) -> str {
// error is that the value type in the hash map is var_info, not a box
for
enclosing
.vars.each_value
|
val
|
{
if
v
.get
(
val
)
{
s
+=
"foo"
;
}
if
*
v
.get
(
val
)
{
s
+=
"foo"
;
}
}
return
s
;
}
...
...
src/test/run-pass/extern-mod-syntax.rs
浏览文件 @
b53057f4
...
...
@@ -11,7 +11,7 @@
// except according to those terms.
extern
mod
std
;
use
std
::
oldmap
::
HashMap
;
use
std
::
json
::
Object
;
pub
fn
main
()
{
io
::
println
(
"Hello world!"
);
...
...
src/test/run-pass/hashmap-memory.rs
浏览文件 @
b53057f4
...
...
@@ -16,17 +16,10 @@
This originally came from the word-count benchmark.
*/
extern
mod
std
;
use
std
::
oldmap
;
use
std
::
oldmap
::
HashMap
;
use
core
::
comm
::
*
;
pub
fn
map
(
filename
:
~
str
,
emit
:
map_reduce
::
putter
)
{
emit
(
filename
,
~
"1"
);
}
mod
map_reduce
{
use
std
::
oldmap
;
use
std
::
oldmap
::
HashMap
;
use
core
::
hashmap
::
linear
::
LinearMap
;
use
core
::
comm
::
*
;
pub
type
putter
=
@
fn
(
~
str
,
~
str
);
...
...
@@ -44,23 +37,20 @@ fn start_mappers(ctrl: SharedChan<ctrl_proto>, inputs: ~[~str]) {
}
fn
map_task
(
ctrl
:
SharedChan
<
ctrl_proto
>
,
input
:
~
str
)
{
let
intermediates
=
oldmap
::
HashMap
();
fn
emit
(
im
:
oldmap
::
HashMap
<~
str
,
int
>
,
ctrl
:
SharedChan
<
ctrl_proto
>
,
key
:
~
str
,
val
:
~
str
)
{
let
mut
c
;
match
im
.find
(
&
key
)
{
Some
(
_
c
)
=>
{
c
=
_
c
}
None
=>
{
let
(
pp
,
cc
)
=
stream
();
error!
(
"sending find_reducer"
);
ctrl
.send
(
find_reducer
(
str
::
to_bytes
(
key
),
cc
));
error!
(
"receiving"
);
c
=
pp
.recv
();
error!
(
c
);
im
.insert
(
key
,
c
);
}
let
intermediates
=
@
mut
LinearMap
::
new
();
fn
emit
(
im
:
&
mut
LinearMap
<~
str
,
int
>
,
ctrl
:
SharedChan
<
ctrl_proto
>
,
key
:
~
str
,
_
val
:
~
str
)
{
if
im
.contains_key
(
&
key
)
{
return
;
}
let
(
pp
,
cc
)
=
stream
();
error!
(
"sending find_reducer"
);
ctrl
.send
(
find_reducer
(
str
::
to_bytes
(
key
),
cc
));
error!
(
"receiving"
);
let
c
=
pp
.recv
();
error!
(
c
);
im
.insert
(
key
,
c
);
}
let
ctrl_clone
=
ctrl
.clone
();
...
...
@@ -75,9 +65,9 @@ pub fn map_reduce(inputs: ~[~str]) {
// This task becomes the master control task. It spawns others
// to do the rest.
let
mut
reducers
:
oldmap
::
Hash
Map
<~
str
,
int
>
;
let
mut
reducers
:
Linear
Map
<~
str
,
int
>
;
reducers
=
oldmap
::
HashMap
();
reducers
=
LinearMap
::
new
();
start_mappers
(
ctrl_chan
,
inputs
.clone
());
...
...
@@ -89,7 +79,7 @@ pub fn map_reduce(inputs: ~[~str]) {
find_reducer
(
k
,
cc
)
=>
{
let
mut
c
;
match
reducers
.find
(
&
str
::
from_bytes
(
k
))
{
Some
(
_
c
)
=>
{
c
=
_
c
;
}
Some
(
&
_
c
)
=>
{
c
=
_
c
;
}
None
=>
{
c
=
0
;
}
}
cc
.send
(
c
);
...
...
src/test/run-pass/issue-1696.rs
浏览文件 @
b53057f4
...
...
@@ -10,11 +10,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
extern
mod
std
;
use
std
::
oldmap
::
HashMap
;
use
core
::
hashmap
::
linear
::
LinearMap
;
pub
fn
main
()
{
let
m
=
HashMap
();
let
m
ut
m
=
LinearMap
::
new
();
m
.insert
(
str
::
to_bytes
(
~
"foo"
),
str
::
to_bytes
(
~
"bar"
));
error!
(
m
);
}
src/test/run-pass/issue-2631-b.rs
浏览文件 @
b53057f4
...
...
@@ -12,14 +12,13 @@
// aux-build:issue-2631-a.rs
extern
mod
req
;
extern
mod
std
;
use
req
::
*
;
use
std
::
oldmap
::
Hash
Map
;
use
core
::
hashmap
::
linear
::
Linear
Map
;
pub
fn
main
()
{
let
v
=
~
[
@~
"hi"
];
let
m
:
req
::
header_map
=
HashMap
();
let
m
ut
m
:
req
::
header_map
=
LinearMap
::
new
();
m
.insert
(
~
"METHOD"
,
@
mut
v
);
request
::
<
int
>
(
m
);
request
::
<
int
>
(
&
m
);
}
src/test/run-pass/issue-2804-2.rs
浏览文件 @
b53057f4
...
...
@@ -12,11 +12,11 @@
// Minimized version of issue-2804.rs. Both check that callee IDs don't
// clobber the previous node ID in a macro expr
extern
mod
std
;
use
std
::
oldmap
::
HashMap
;
fn
add_interfaces
(
managed_ip
:
~
str
,
device
:
std
::
oldmap
::
HashMap
<~
str
,
int
>
)
{
error!
(
"%s, %?"
,
managed_ip
,
device
[
~
"interfaces"
]);
use
core
::
hashmap
::
linear
::
LinearMap
;
fn
add_interfaces
(
managed_ip
:
~
str
,
device
:
LinearMap
<~
str
,
int
>
)
{
error!
(
"%s, %?"
,
managed_ip
,
device
.get
(
&~
"interfaces"
));
}
pub
fn
main
()
{}
src/test/run-pass/issue-2804.rs
浏览文件 @
b53057f4
...
...
@@ -11,8 +11,7 @@
// except according to those terms.
extern
mod
std
;
use
core
::
io
::
WriterUtil
;
use
std
::
oldmap
::
HashMap
;
use
core
::
hashmap
::
linear
::
LinearMap
;
use
std
::
json
;
enum
object
{
...
...
@@ -59,19 +58,20 @@ fn add_interface(store: int, managed_ip: ~str, data: std::json::Json) -> (~str,
}
}
fn
add_interfaces
(
store
:
int
,
managed_ip
:
~
str
,
device
:
std
::
oldmap
::
Hash
Map
<~
str
,
std
::
json
::
Json
>
)
->
~
[(
~
str
,
object
)]
fn
add_interfaces
(
store
:
int
,
managed_ip
:
~
str
,
device
:
Linear
Map
<~
str
,
std
::
json
::
Json
>
)
->
~
[(
~
str
,
object
)]
{
match
device
[
~
"interfaces"
]
match
device
.get
(
&~
"interfaces"
)
{
std
::
json
::
List
(
interfaces
)
=>
&
std
::
json
::
List
(
ref
interfaces
)
=>
{
do
vec
::
map
(
interfaces
)
|
interface
|
{
do
interfaces
.map
|
interface
|
{
add_interface
(
store
,
copy
managed_ip
,
copy
*
interface
)
}
}
_
=>
{
error!
(
"Expected list for %s interfaces but found %?"
,
managed_ip
,
device
[
~
"interfaces"
]);
error!
(
"Expected list for %s interfaces but found %?"
,
managed_ip
,
device
.get
(
&~
"interfaces"
));
~
[]
}
}
...
...
src/test/run-pass/issue-3026.rs
浏览文件 @
b53057f4
...
...
@@ -10,12 +10,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
extern
mod
std
;
use
std
::
oldmap
::
HashMap
;
use
std
::
oldmap
;
use
core
::
hashmap
::
linear
::
LinearMap
;
pub
fn
main
()
{
let
buggy_map
:
HashMap
<
uint
,
&
uint
>
=
HashMap
::
<
uint
,
&
uint
>
();
let
mut
buggy_map
:
LinearMap
<
uint
,
&
uint
>
=
LinearMap
::
new
::
<
uint
,
&
uint
>
();
let
x
=
~
1
;
buggy_map
.insert
(
42
,
&*
x
);
}
src/test/run-pass/issue-3559.rs
浏览文件 @
b53057f4
...
...
@@ -14,7 +14,6 @@
extern
mod
std
;
use
core
::
io
::{
WriterUtil
};
use
std
::
oldmap
::
*
;
#[cfg(test)]
fn
check_strs
(
actual
:
&
str
,
expected
:
&
str
)
->
bool
...
...
@@ -30,7 +29,7 @@ fn check_strs(actual: &str, expected: &str) -> bool
#[test]
fn
tester
()
{
let
table
=
Hash
Map
();
let
mut
table
=
core
::
hashmap
::
linear
::
Linear
Map
();
table
.insert
(
@~
"one"
,
1
);
table
.insert
(
@~
"two"
,
2
);
fail_unless!
(
check_strs
(
table
.to_str
(),
~
"xxx"
));
// not sure what expected should be
...
...
src/test/run-pass/issue-4092.rs
浏览文件 @
b53057f4
...
...
@@ -8,9 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
extern
mod
std
;
use
core
::
hashmap
::
linear
::
LinearMap
;
pub
fn
main
()
{
let
x
=
std
::
oldmap
::
HashMap
();
let
mut
x
=
LinearMap
::
new
();
x
.insert
((
@
"abc"
,
0
),
0
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录