Skip to content

Commit 031cc39

Browse files
committed
---
yaml --- r: 67207 b: refs/heads/master c: de2b5c5 h: refs/heads/master i: 67205: df1c7d8 67203: e9ae8ca 67199: 30c83ab v: v3
1 parent 6a6a584 commit 031cc39

File tree

6 files changed

+22
-15
lines changed

6 files changed

+22
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 0a5d1a1b81ccb839b44c9251d9ffad2838179f1f
2+
refs/heads/master: de2b5c50cd80e8aa65d79c8dd96d9ee93538a012
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/libstd/hashmap.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,11 @@ impl<K:Hash + Eq,V> HashMap<K, V> {
255255
let len_buckets = self.buckets.len();
256256
let bucket = self.buckets[idx].take();
257257

258-
let value = do bucket.map_consume |bucket| {
259-
bucket.value
258+
let value = match bucket {
259+
None => None,
260+
Some(Bucket{value, _}) => {
261+
Some(value)
262+
},
260263
};
261264

262265
/* re-inserting buckets may cause changes in size, so remember
@@ -502,6 +505,7 @@ impl<K: Hash + Eq, V> HashMap<K, V> {
502505
// `consume_rev_iter` is more efficient than `consume_iter` for vectors
503506
HashMapConsumeIterator {iter: self.buckets.consume_rev_iter()}
504507
}
508+
505509
}
506510

507511
impl<K: Hash + Eq, V: Clone> HashMap<K, V> {
@@ -520,12 +524,14 @@ impl<K:Hash + Eq,V:Eq> Eq for HashMap<K, V> {
520524
fn eq(&self, other: &HashMap<K, V>) -> bool {
521525
if self.len() != other.len() { return false; }
522526

523-
do self.iter().all |(key, value)| {
527+
for self.iter().advance |(key, value)| {
524528
match other.find(key) {
525-
None => false,
526-
Some(v) => value == v
529+
None => return false,
530+
Some(v) => if value != v { return false },
527531
}
528532
}
533+
534+
true
529535
}
530536

531537
fn ne(&self, other: &HashMap<K, V>) -> bool { !self.eq(other) }

trunk/src/test/run-fail/bug-2470-bounds-check-overflow-2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
// xfail-test
1212
// error-pattern:index out of bounds
1313

14+
use std::uint;
15+
1416
fn main() {
1517
let x = ~[1u,2u,3u];
1618

trunk/src/test/run-fail/bug-2470-bounds-check-overflow-3.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
// xfail-test
1212
// error-pattern:index out of bounds
1313

14+
use std::u64;
15+
1416
#[cfg(target_arch="x86")]
1517
fn main() {
1618
let x = ~[1u,2u,3u];

trunk/src/test/run-fail/too-much-recursion-unwinding.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// during unwinding
1616

1717
fn recurse() {
18-
log(debug, "don't optimize me out");
18+
info!("don't optimize me out");
1919
recurse();
2020
}
2121

@@ -35,9 +35,7 @@ impl Drop for r {
3535
}
3636

3737
fn r(recursed: *mut bool) -> r {
38-
unsafe {
39-
r { recursed: recursed }
40-
}
38+
r { recursed: recursed }
4139
}
4240

4341
fn main() {

trunk/src/test/run-fail/unwind-misc-1.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test - issue #5512, fails but exits with 0
12-
11+
// exec-env:RUST_NEWRT=1
1312
// error-pattern:fail
1413

1514
fn main() {
1615
let count = @mut 0u;
1716
let mut map = std::hashmap::HashMap::new();
1817
let mut arr = ~[];
19-
for uint::range(0u, 10u) |i| {
20-
arr += ~[@~"key stuff"];
21-
map.insert(arr.clone(), arr + ~[@~"value stuff"]);
18+
for std::uint::range(0u, 10u) |i| {
19+
arr.push(@~"key stuff");
20+
map.insert(arr.clone(), arr + &[@~"value stuff"]);
2221
if arr.len() == 5 {
2322
fail!();
2423
}

0 commit comments

Comments
 (0)