diff options
| author | bors <bors@rust-lang.org> | 2013-04-10 08:28:02 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-04-10 08:28:02 -0700 |
| commit | ac9dc69bf3c0e4c46fadeab76229ba35f61d8158 (patch) | |
| tree | 7583fe26dbee8952573b38dff904ccda2c7ec566 /src/libstd/workcache.rs | |
| parent | 5d01f649b4cda55cb6ec358d0e2685c9901f62a1 (diff) | |
| parent | 5606fc0c90461db40faeca16d7bffd9e61c2be73 (diff) | |
| download | rust-ac9dc69bf3c0e4c46fadeab76229ba35f61d8158.tar.gz rust-ac9dc69bf3c0e4c46fadeab76229ba35f61d8158.zip | |
auto merge of #5796 : nikomatsakis/rust/issue-5656-fix-map-iteration, r=nikomatsakis
Revert map.each to something which takes two parameters rather than a tuple. The current setup iterates over `BaseIter<(&'self K, &'self V)>` where 'self is a lifetime declared *in the `each()` method*. You can't place such a type in the impl declaration. The compiler currently allows it, but this will not be legal under #5656 and I'm pretty sure it's not sound now. It's too bad that maps can't implement `BaseIter` (at least not over a tuple as they do here) but I think it has to be this way for the time being. r? @thestinger
Diffstat (limited to 'src/libstd/workcache.rs')
| -rw-r--r-- | src/libstd/workcache.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/workcache.rs b/src/libstd/workcache.rs index 3e494d0236e..c4b450810aa 100644 --- a/src/libstd/workcache.rs +++ b/src/libstd/workcache.rs @@ -145,7 +145,7 @@ impl WorkMap { impl<S:Encoder> Encodable<S> for WorkMap { fn encode(&self, s: &S) { let mut d = ~[]; - for self.each |&(k, v)| { + for self.each |k, v| { d.push((copy *k, copy *v)) } sort::tim_sort(d); @@ -319,7 +319,7 @@ impl TPrep for Prep { } fn all_fresh(&self, cat: &str, map: &WorkMap) -> bool { - for map.each |&(k, v)| { + for map.each |k, v| { if ! self.is_fresh(cat, k.kind, k.name, *v) { return false; } |
