-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
extend lifetime on binary_search_by_key of SliceExt trait #34762
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (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. |
@alexcrichton I need to add the example test case also. I am not sure about the location of test case to add, Is |
a10b263
to
8a2b740
Compare
Thanks for the PR @creativcoder! And yeah either there or in |
It looks like this is missing a fix to the version in libstd? |
fn binary_search_by_key<'a, B, F>(&'a self, b: &B, f: F) -> Result<usize, usize> | ||
where F: FnMut(&'a Self::Item) -> B, | ||
B: Ord, | ||
Self::Item: 'a; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the Self::Item: 'a
bound actually necessary? It looks redundant.
Crater reports one regression which looks spurious, so when paired with our confidence that this isn't actually a breaking change, looks like it's good from a stability perspective. cc @rust-lang/libs |
@eefriedman to clarify, you mean the signature in libcollections, right? Probably also means the crater run needs to be redone. |
Yes, that's what I meant; sorry, I was thinking "outside libcore" without really considering where exactly it is. |
I'm +1 on this change. |
The signature in libcollections has been updated and added the test |
Thanks @creativcoder! Could you also do it for the other |
Done |
Crater reports two regressions, both of which are spurious, so... @bors: r+ |
📌 Commit 6fd1752 has been approved by |
⌛ Testing commit 6fd1752 with merge 58c5716... |
extend lifetime on binary_search_by_key of SliceExt trait Fixes #34683.
Fixes #34683.