diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2011-10-25 17:57:26 +0200 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2011-10-25 17:57:26 +0200 |
| commit | 013107a25c92262f515b1da8a473c7fad32269df (patch) | |
| tree | 06504079d813df238b1647cdd23b5e313072c474 /src/test/stdtest | |
| parent | cfdf193c4671a11e40743748d9cded9603386346 (diff) | |
| download | rust-013107a25c92262f515b1da8a473c7fad32269df.tar.gz rust-013107a25c92262f515b1da8a473c7fad32269df.zip | |
Properly take mutable object fields into account during alias analysis
Closes #1055
Diffstat (limited to 'src/test/stdtest')
| -rw-r--r-- | src/test/stdtest/map.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/test/stdtest/map.rs b/src/test/stdtest/map.rs index 45d1a535e02..32ecae5c6c8 100644 --- a/src/test/stdtest/map.rs +++ b/src/test/stdtest/map.rs @@ -8,11 +8,13 @@ import std::uint; import std::util; import std::option; + #[test] fn test_simple() { log "*** starting test_simple"; fn eq_uint(&&x: uint, &&y: uint) -> bool { ret x == y; } - let hasher_uint: map::hashfn<uint> = bind util::id(_); + fn uint_id(&&x: uint) -> uint { x } + let hasher_uint: map::hashfn<uint> = uint_id; let eqer_uint: map::eqfn<uint> = eq_uint; let hasher_str: map::hashfn<str> = str::hash; let eqer_str: map::eqfn<str> = str::eq; @@ -84,8 +86,9 @@ fn test_growth() { log "*** starting test_growth"; let num_to_insert: uint = 64u; fn eq_uint(&&x: uint, &&y: uint) -> bool { ret x == y; } + fn uint_id(&&x: uint) -> uint { x } log "uint -> uint"; - let hasher_uint: map::hashfn<uint> = bind util::id(_); + let hasher_uint: map::hashfn<uint> = uint_id; let eqer_uint: map::eqfn<uint> = eq_uint; let hm_uu: map::hashmap<uint, uint> = map::mk_hashmap::<uint, uint>(hasher_uint, eqer_uint); |
