-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Cleanup and stability for core::slice #16332
Conversation
The most substantial change is to make the return type of |
@@ -47,20 +48,25 @@ use ptr::RawPtr; | |||
use mem; | |||
use mem::size_of; | |||
use kinds::marker; | |||
use raw::{Repr, Slice}; | |||
use raw::{Repr}; |
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.
Ditch the {}
@aturon There's a few notes of mine that are still outstanding, but they're not serious issues. |
Thanks, then I'm going to go ahead and get this headed to bors. |
@brson needs a rebase, then this is ready to go. |
Rebased. |
ImmutableVector -> ImmutableSlice ImmutableEqVector -> ImmutableEqSlice ImmutableOrdVector -> ImmutableOrdSlice MutableVector -> MutableSlice MutableVectorAllocating -> MutableSliceAllocating MutableCloneableVector -> MutableCloneableSlice MutableOrdVector -> MutableOrdSlice These are all in the prelude so most code will not break. [breaking-change]
This required some contortions because importing both raw::Slice and slice::Slice makes rustc crash. Since `Slice` is in the prelude, this renaming is unlikely to casue breakage. [breaking-change]
Deprecate the previous.
These are equivalent to slice_from and slice_to.
Deprecate the previous.
This is in the prelude and won't break much code. [breaking-change]
These are like the existing bsearch methods but if the search fails, it returns the next insertion point. The new `binary_search` returns a `BinarySearchResult` that is either `Found` or `NotFound`. For convenience, the `found` and `not_found` methods convert to `Option`, ala `Result`. Deprecate bsearch and bsearch_elem.
Much of this is as discussed[1]. Many things are marked [1]: https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-06.md
This makes it consistent with the same functions for slices, and allows the search closure to be specified last. [breaking-change]
This implements some of the recommendations from https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-06.md. Explanation in commits.
This commit is another in the series of vector slice API stabilization. The focus here is the *mutable* slice API. Largely, this API inherits the stability attributes [previously assigned](rust-lang#16332) to the analogous methods on immutable slides. It also adds comments to a few `unstable` attributes that were previously missing them. In addition, the commit adds several `_mut` variants of APIs that were missing: - `init_mut` - `head_mut` - `tail_mut` - `splitn_mut` - `rsplitn_mut` Some of the unsafe APIs -- `unsafe_set`, `init_elem`, and `copy_memory` -- were deprecated in favor of working through `as_mut_ptr`, to simplify the API surface. Due to deprecations, this is a: [breaking-change]
…ichton This commit is another in the series of vector slice API stabilization. The focus here is the *mutable* slice API. Largely, this API inherits the stability attributes [previously assigned](#16332) to the analogous methods on immutable slides. It also adds comments to a few `unstable` attributes that were previously missing them. In addition, the commit adds several `_mut` variants of APIs that were missing: - `init_mut` - `head_mut` - `tail_mut` - `splitn_mut` - `rsplitn_mut` Some of the unsafe APIs -- `unsafe_set`, `init_elem`, and `copy_memory` -- were deprecated in favor of working through `as_mut_ptr`, to simplify the API surface. Due to deprecations, this is a: [breaking-change]
This commit is another in the series of vector slice API stabilization. The focus here is the *mutable* slice API. Largely, this API inherits the stability attributes [previously assigned](rust-lang#16332) to the analogous methods on immutable slides. It also adds comments to a few `unstable` attributes that were previously missing them. In addition, the commit adds several `_mut` variants of APIs that were missing: - `init_mut` - `head_mut` - `tail_mut` - `splitn_mut` - `rsplitn_mut` Some of the unsafe APIs -- `unsafe_set`, `init_elem`, and `copy_memory` -- were deprecated in favor of working through `as_mut_ptr`, to simplify the API surface. Due to deprecations, this is a: [breaking-change]
…ichton This commit is another in the series of vector slice API stabilization. The focus here is the *mutable* slice API. Largely, this API inherits the stability attributes [previously assigned](#16332) to the analogous methods on immutable slides. It also adds comments to a few `unstable` attributes that were previously missing them. In addition, the commit adds several `_mut` variants of APIs that were missing: - `init_mut` - `head_mut` - `tail_mut` - `splitn_mut` - `rsplitn_mut` Some of the unsafe APIs -- `unsafe_set`, `init_elem`, and `copy_memory` -- were deprecated in favor of working through `as_mut_ptr`, to simplify the API surface. Due to deprecations, this is a: [breaking-change]
This implements some of the recommendations from https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-06.md.
Explanation in commits.