Skip to content
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

#31262 add a public hasher function for HashSet and HashMap #31357

Merged
merged 1 commit into from
Feb 11, 2016

Conversation

rthomas
Copy link
Contributor

@rthomas rthomas commented Feb 2, 2016

add a public hasher function for HashSet and HashMap

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

/// Returns the hasher that is used or the detault hasher if none is
/// specified.
#[inline]
#[stable(feature = "hashmap_build_hasher", since = "1.7.0")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this stable, but the corresponding method for HashMap unstable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, should have been stable. Fixed.

@alexcrichton alexcrichton added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Feb 2, 2016
@@ -642,6 +642,14 @@ impl<K, V, S> HashMap<K, V, S>
HashMap::with_capacity_and_hasher(capacity, hash_state)
}

/// Returns the hasher that is used or the default hasher if none is
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this would be better as something like:

Returns a reference to the map's hasher.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@apasel422
Copy link
Contributor

CC @rust-lang/libs

@@ -642,6 +642,13 @@ impl<K, V, S> HashMap<K, V, S>
HashMap::with_capacity_and_hasher(capacity, hash_state)
}

/// Returns a reference to the maps hasher.
Copy link
Contributor

Choose a reason for hiding this comment

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

map's

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@Gankra
Copy link
Contributor

Gankra commented Feb 6, 2016

I don't believe we want to make this functionality insta-stable? Probably want to introduce a new feature for this.

Edit: I may be wrong though, it's 3 4am.

@Gankra
Copy link
Contributor

Gankra commented Feb 6, 2016

CC #31262

@pnkfelix
Copy link
Member

pnkfelix commented Feb 9, 2016

I don't believe we want to make this functionality insta-stable? Probably want to introduce a new feature for this.

I second this,

@rthomas
Copy link
Contributor Author

rthomas commented Feb 9, 2016

@pnkfelix yep - just updated the issue and will push the PR when tests complete.

@apasel422
Copy link
Contributor

@rthomas Thanks! Could you squash these commits?

@alexcrichton
Copy link
Member

The libs team discussed this during triage today and the conclusion was that this is good to go. As well as squashing like @apasel422 mentioned, could you also remove the #[inline] tags as well? These are already inlined across crates because of the generics and probably don't really need the extra help from LLVM.

Other than that looks good to me, thanks for the PR @rthomas!

@rthomas
Copy link
Contributor Author

rthomas commented Feb 11, 2016

Thanks @apasel422 and @alexcrichton, I've removed the #[inline] tags and squashed the commits.

@alexcrichton
Copy link
Member

@bors: r+ ca7f550

@bors
Copy link
Contributor

bors commented Feb 11, 2016

⌛ Testing commit ca7f550 with merge b9732ed...

bors added a commit that referenced this pull request Feb 11, 2016
add a public hasher function for HashSet and HashMap
@bors bors merged commit ca7f550 into rust-lang:master Feb 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants