Skip to content

auto: fix lazy treemap iterator + some cleanup #4815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/libcore/hashmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ pub mod linear {
buckets: ~[Option<Bucket<K, V>>],
}

// FIXME(#3148) -- we could rewrite FoundEntry
// to have type Option<&Bucket<K, V>> which would be nifty
// However, that won't work until #3148 is fixed
// We could rewrite FoundEntry to have type Option<&Bucket<K, V>>
// which would be nifty
enum SearchResult {
FoundEntry(uint), FoundHole(uint), TableFull
}
Expand Down Expand Up @@ -296,8 +295,6 @@ pub mod linear {
FoundEntry(idx) => {
match self.buckets[idx] {
Some(ref bkt) => {
// FIXME(#3148)---should be inferred
let bkt: &self/Bucket<K, V> = bkt;
Some(&bkt.value)
}
None => {
Expand Down
8 changes: 0 additions & 8 deletions src/libstd/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -856,9 +856,6 @@ pub impl Decoder: serialize::Decoder {
debug!("read_vec_elt(idx=%u)", idx);
match *self.peek() {
List(ref list) => {
// FIXME(#3148)---should be inferred
let list: &self/~[Json] = list;

self.stack.push(&list[idx]);
f()
}
Expand All @@ -885,9 +882,6 @@ pub impl Decoder: serialize::Decoder {
let top = self.peek();
match *top {
Object(ref obj) => {
// FIXME(#3148) This hint should not be necessary.
let obj: &self/~Object = obj;

match obj.find(&name.to_owned()) {
None => die!(fmt!("no such field: %s", name)),
Some(json) => {
Expand Down Expand Up @@ -917,8 +911,6 @@ pub impl Decoder: serialize::Decoder {
debug!("read_tup_elt(idx=%u)", idx);
match *self.peek() {
List(ref list) => {
// FIXME(#3148)---should be inferred
let list: &self/~[Json] = list;
self.stack.push(&list[idx]);
f()
}
Expand Down
4 changes: 0 additions & 4 deletions src/libstd/smallintmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ pub impl<V> SmallIntMap<V> {
}

pub impl<V: Copy> SmallIntMap<V> {
// FIXME: #4733, remove after the next snapshot
#[cfg(stage2)]
fn update_with_key(&mut self, key: uint, val: V,
ff: fn(uint, V, V) -> V) -> bool {
match self.find(&key) {
Expand All @@ -126,8 +124,6 @@ pub impl<V: Copy> SmallIntMap<V> {
}
}

// FIXME: #4733, remove after the next snapshot
#[cfg(stage2)]
fn update(&mut self, key: uint, newval: V, ff: fn(V, V) -> V) -> bool {
self.update_with_key(key, newval, |_k, v, v1| ff(v,v1))
}
Expand Down
Loading