-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
SliceExt::binary_search has a different signature than slice::binary_search #41561
Comments
This was attempted to get generalized in libstd in #41590, but unfortunately it caused too much breakage so the libs team has decided to not land that PR. An alternate route to fixing this though would be to de-generalize the signature in libcore. This is of course a breaking change but we may be lucky and have few users of this function in libcore, so we may be able to get away with it. The libs team would be interested in seeing a PR to de-generalize in libcore (make it the same as libstd's signature) and then have a crater run to evaluate the impact. From that point we can evaluate what to do next. |
cc #32632 |
Remove Borrow bound from SliceExt::binary_search #37761 added a Borrow bound to `binary_search` and `binary_search_by_key` in `core::SliceExt`, but did not add it to the methods in `std::slice`. #41590 attempted to add this bound to `std::slice` but was not merged due to breakage. This PR removes the bound in `core::SliceExt`, so that these methods will have the same signature in `core` and `std`. Fixes #41561
…ig, r=alexcrichton Remove Borrow bound from SliceExt::binary_search rust-lang#37761 added a Borrow bound to `binary_search` and `binary_search_by_key` in `core::SliceExt`, but did not add it to the methods in `std::slice`. rust-lang#41590 attempted to add this bound to `std::slice` but was not merged due to breakage. This PR removes the bound in `core::SliceExt`, so that these methods will have the same signature in `core` and `std`. Fixes rust-lang#41561
…richton Remove Borrow bound from SliceExt::binary_search #37761 added a Borrow bound to `binary_search` and `binary_search_by_key` in `core::SliceExt`, but did not add it to the methods in `std::slice`. #41590 attempted to add this bound to `std::slice` but was not merged due to breakage. This PR removes the bound in `core::SliceExt`, so that these methods will have the same signature in `core` and `std`. Fixes #41561
SliceExt
parameterizesSelf::Item
overBorrow
, but slices don't have that parameterization. This makes the core slice API different from the std slice API, which is not supposed to be the case.PR where this change was made.
The text was updated successfully, but these errors were encountered: