-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Tracking issue for push_all
stabilization
#27744
Comments
cc #26902 |
Unless specialization lands soon, I'm tempted to just stabilize this as "this will be deprecated when it's no longer necessary". |
Have the IR (lack of) hinting issues been worked out? |
Nominating for 1.6 discussion. |
🔔 This issue is now entering its cycle-long final comment period for stabilization 🔔 The conclusion of the libs team is that we can stabilize this and just deprecate it once specialization lands and makes this function obsolete. |
IMO, planned deprecation defeats the point of stabilizing it in the first place. i.e. I still won't want to use it if it's definitely going to be yanked out later... |
It's not going to be yanked out ever if stabilized. It will eventually be deprecated in favor of extend, but remain in place. |
Ok, I thought deprecation was more aggressive than that. No problem then. |
I agree with this.
IMO, that would be a poor choice. In the discussion on One of the main reasons for moving ahead with Conversely, if useful performance guarantees are added to it (at most one resizing of the array, at most one bounds check on each array, equivalent to It is also unfortunate that the name |
Would it be worth considering another name for this method? I find |
I propose renaming this function to |
I don't think there's widespread agreement about adding ad hoc specializations/intrinsics, barring very exceptional circumstances. But @rust-lang/lang and @rust-lang/compiler may want to weigh in.
I'm a little confused about the overall thrust here. To be clear, the reason that Now, that said, i think the performance guarantees you're raising are an important (though orthogonal) point. One uncomfortable thing about the current One way to address this desire might be to add more ad hoc intrinsics, but I wonder if there's any way we might eventually allow "inline MIR", so to speak, and whether that'd be enough to express the precise code you want to generate. On the whole, I still think it's reasonable to stabilize something
@alexcrichton didn't mention this, but no one was particularly a fan of the name. 👍 on renaming, and matching the |
👍 |
+1000 to not adding an ad hoc hack here. However, I'd love to see some kind of push_all stabilised - it's probably the unstable function I use the most. |
Absolutely, I would say the same thing: it's very unlikely there is any agreement about it. It's just my crazy idea. 😄 |
On Mon, Nov 09, 2015 at 01:04:45PM -0800, Nick Cameron wrote:
and +1K more |
Notice that the |
The libs team discussed this during triage today and the decision was to stabilize while renaming the method to |
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes rust-lang#27585 Closes rust-lang#27704 Closes rust-lang#27707 Closes rust-lang#27710 Closes rust-lang#27711 Closes rust-lang#27727 Closes rust-lang#27740 Closes rust-lang#27744 Closes rust-lang#27799 Closes rust-lang#27801 cc rust-lang#27801 (doesn't close as `Chars` is still unstable) Closes rust-lang#28968
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
The
Vec::push_all
method special-cases pushing a slice onto a vector, and historically has performed much better than usingextend
(depending on how LLVM optimizations are working out).We need to offer a method with maximal performance somehow, but ideally this would come from
extend
, either through optimization or through impl specialization.The text was updated successfully, but these errors were encountered: