Skip to content

Basic refactoring of HashMap #32058

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

Merged
merged 12 commits into from
Mar 23, 2016
Merged

Conversation

pczarn
Copy link
Contributor

@pczarn pczarn commented Mar 5, 2016

No description provided.

@pczarn
Copy link
Contributor Author

pczarn commented Mar 5, 2016

I'm trying to add changes with obvious value separately from other changes.
cc @gankro @cgaebel

@cgaebel
Copy link
Contributor

cgaebel commented Mar 5, 2016

travis is failing

@Gankra
Copy link
Contributor

Gankra commented Mar 5, 2016

Sadly, I am currently contractually barred from reviewing this code. r? @cgaebel

@Gankra
Copy link
Contributor

Gankra commented Mar 5, 2016

Ah shoot.

r? @apasel422

@Gankra
Copy link
Contributor

Gankra commented Mar 5, 2016

uhhhh

r? @bluss ???

@Gankra
Copy link
Contributor

Gankra commented Mar 5, 2016

bors where r u

@bluss
Copy link
Member

bluss commented Mar 5, 2016

no homu, no highfive, aaaah

@cgaebel
Copy link
Contributor

cgaebel commented Mar 5, 2016

I'll take a look when travis passess.

@pczarn pczarn force-pushed the hashmap-initial-refactoring branch from c9c4e93 to d67cf45 Compare March 5, 2016 21:22
@pczarn
Copy link
Contributor Author

pczarn commented Mar 5, 2016

Sorry, forgot to push changes

@apasel422
Copy link
Contributor

collections::hash::set::test_set::test_replace failed.

@pczarn
Copy link
Contributor Author

pczarn commented Mar 6, 2016

fixed

@apasel422 apasel422 assigned apasel422 and unassigned apasel422 Mar 6, 2016
}
}

impl<K, V, M> DerefMut for FullBucket<K, V, M> where M: DerefMut<Target=RawTable<K, V>> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that this impl is safe - giving arbitrary access to the underlying RawTable means that a user could resize or replace the RawTable out from under the FullBucket, making it invalid.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative would be to put an equivalent but unsafe method on Put to fetch the table. By making the method unsafe, any violation of memory safety would still have to use unsafe code.

@pczarn
Copy link
Contributor Author

pczarn commented Mar 22, 2016

Added fixes for @gereeter's review.
@cgaebel @apasel422, if you want to review, there's no rush

@cgaebel
Copy link
Contributor

cgaebel commented Mar 22, 2016

The type signatures are getting a little crazy for a simple hashtable, but that's neither the singular doing of this patch, nor necessarily uncalled for.

Looks good to me.

@apasel422
Copy link
Contributor

@bors: r+ 64adca7

@bors
Copy link
Collaborator

bors commented Mar 23, 2016

⌛ Testing commit 64adca7 with merge 1abcf47...

@bors
Copy link
Collaborator

bors commented Mar 23, 2016

💔 Test failed - auto-win-msvc-64-opt-rustbuild

@alexcrichton
Copy link
Member

@bors: retry

On Tuesday, March 22, 2016, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-win-msvc-64-opt-rustbuild
http://buildbot.rust-lang.org/builders/auto-win-msvc-64-opt-rustbuild/builds/455


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#32058 (comment)

@bors
Copy link
Collaborator

bors commented Mar 23, 2016

⌛ Testing commit 64adca7 with merge 8ba2ea5...

bors added a commit that referenced this pull request Mar 23, 2016
@bors bors merged commit 64adca7 into rust-lang:master Mar 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants