about summary refs log tree commit diff
path: root/src/liballoc/boxed.rs
AgeCommit message (Collapse)AuthorLines
2016-05-28rustfmt liballoc folderSrinivas Reddy Thatiparthy-2/+3
2016-05-12fix tidyAlex Burka-4/+8
2016-05-12update "reason" for fnbox feature gateAlex Burka-4/+4
It isn't "newly introduced" anymore.
2016-03-11alloc: Add unstable issue for FnBox APIsAlex Crichton-4/+4
2016-02-08Implement fmt::Pointer for pointers to unsized typesKamal Marhubi-1/+1
This allows printing pointers to unsized types with the {:p} formatting directive. The following impls are extended to unsized types: - impl<'a, T: ?Sized> Pointer for &'a T - impl<'a, T: ?Sized> Pointer for &'a mut T - impl<T: ?Sized> Pointer for *const T - impl<T: ?Sized> Pointer for *mut T - impl<T: ?Sized> fmt::Pointer for Box<T> - impl<T: ?Sized> fmt::Pointer for Rc<T> - impl<T: ?Sized> fmt::Pointer for Arc<T>
2016-01-14Rollup merge of #30912 - tshepang:remove-distraction, r=steveklabnikSteve Klabnik-1/+1
2016-01-14Rollup merge of #30910 - tshepang:improve-description, r=steveklabnikSteve Klabnik-1/+1
2016-01-14doc: that suffix serves as mere distractionTshepang Lekhonkhobe-1/+1
2016-01-14doc: "x" is used as variable name on this API, so avoid using it hereTshepang Lekhonkhobe-1/+1
2016-01-14doc: "moves" has a specific meaning in Rust, so avoid using it hereTshepang Lekhonkhobe-1/+1
2016-01-13Improve grammar of Box::{into,from}_raw docsJake Goulding-14/+14
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-1/+0
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 #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
2015-11-24rustfmt: liballoc, liballoc_*, libarenaNick Cameron-8/+6
2015-11-18Add missing annotations and some testsVadim Petrochenkov-0/+22
2015-11-16Auto merge of #29580 - alexbool:smart-pointer-conversion, r=alexcrichtonbors-0/+8
Sometimes when writing generic code you want to abstract over owning/pointer type so that calling code isn't restricted by one concrete owning/pointer type. This commit makes possible such code: ```rust fn i_will_work_with_arc<T: Into<Arc<MyTy>>>(t: T) { let the_arc = t.into(); // Do something } i_will_work_with_arc(MyTy::new()); i_will_work_with_arc(Box::new(MyTy::new())); let arc_that_i_already_have = Arc::new(MyTy::new()); i_will_work_with_arc(arc_that_i_already_have); ``` Please note that this patch doesn't work with DSTs. Also to mention, I made those impls stable, and I don't know whether they should be actually stable from the beginning. Please tell me if this should be feature-gated.
2015-11-16Fix feature nameAlexander Bulaev-1/+1
2015-11-06Remove stability annotations from trait impl itemsVadim Petrochenkov-2/+0
Remove `stable` stability annotations from inherent impls
2015-11-04liballoc: implement From for Box, Rc, ArcAlexander Bulaev-0/+8
Sometimes when writing generic code you want to abstract over owning/pointer type so that calling code isn't restricted by one concrete owning/pointer type. This commit makes possible such code: ``` fn i_will_work_with_arc<T: Into<Arc<MyTy>>>(t: T) { let the_arc = t.into(); // Do something } i_will_work_with_arc(MyTy::new()); i_will_work_with_arc(Box::new(MyTy::new())); let arc_that_i_already_have = Arc::new(MyTy::new()); i_will_work_with_arc(arc_that_i_already_have); ``` Please note that this patch doesn't work with DSTs.
2015-10-17Remove some trivial `transmute`sAndrew Paseltiner-1/+1
`rbml::writer::Encoder::unsafe_clone` had no users across the entire repo.
2015-10-11Run rustfmt on liballoc.Ahmed Charles-4/+16
2015-10-02std: Add AsRef/AsMut impls to Box/Rc/ArcAlex Crichton-0/+10
These common traits were left off originally by accident from these smart pointers, and a past attempt (#26008) to add them was later reverted (#26160) due to unexpected breakge (#26096) occurring. The specific breakage in worry is the meaning of this return value changed: let a: Box<Option<T>> = ...; a.as_ref() Currently this returns `Option<&T>` but after this change it will return `&Option<T>` because the `AsRef::as_ref` method shares the same name as `Option::as_ref`. A [crater report][crater] of this change, however, has shown that the fallout of this change is quite minimal. These trait implementations are "the right impls to add" to these smart pointers and would enable various generalizations such as those in #27197. [crater]: https://gist.github.com/anonymous/0ba4c3512b07641c0f99 This commit is a breaking change for the above reasons mentioned, and the mitigation strategies look like any of: Option::as_ref(&a) a.as_ref().as_ref() (*a).as_ref()
2015-09-25Auto merge of #28610 - nrc:fmt6, r=brsonbors-34/+67
2015-09-24Remove the deprecated box(PLACE) syntax.Eduard Burtescu-2/+1
2015-09-24manual fixupsNick Cameron-3/+2
2015-09-24rustfmt liballocNick Cameron-34/+68
2015-09-11std: Stabilize/deprecate features for 1.4Alex Crichton-11/+3
The FCP is coming to a close and 1.4 is coming out soon, so this brings in the libs team decision for all library features this cycle. Stabilized APIs: * `<Box<str>>::into_string` * `Arc::downgrade` * `Arc::get_mut` * `Arc::make_mut` * `Arc::try_unwrap` * `Box::from_raw` * `Box::into_raw` * `CStr::to_str` * `CStr::to_string_lossy` * `CString::from_raw` * `CString::into_raw` * `IntoRawFd::into_raw_fd` * `IntoRawFd` * `IntoRawHandle::into_raw_handle` * `IntoRawHandle` * `IntoRawSocket::into_raw_socket` * `IntoRawSocket` * `Rc::downgrade` * `Rc::get_mut` * `Rc::make_mut` * `Rc::try_unwrap` * `Result::expect` * `String::into_boxed_slice` * `TcpSocket::read_timeout` * `TcpSocket::set_read_timeout` * `TcpSocket::set_write_timeout` * `TcpSocket::write_timeout` * `UdpSocket::read_timeout` * `UdpSocket::set_read_timeout` * `UdpSocket::set_write_timeout` * `UdpSocket::write_timeout` * `Vec::append` * `Vec::split_off` * `VecDeque::append` * `VecDeque::retain` * `VecDeque::split_off` * `rc::Weak::upgrade` * `rc::Weak` * `slice::Iter::as_slice` * `slice::IterMut::into_slice` * `str::CharIndices::as_str` * `str::Chars::as_str` * `str::split_at_mut` * `str::split_at` * `sync::Weak::upgrade` * `sync::Weak` * `thread::park_timeout` * `thread::sleep` Deprecated APIs * `BTreeMap::with_b` * `BTreeSet::with_b` * `Option::as_mut_slice` * `Option::as_slice` * `Result::as_mut_slice` * `Result::as_slice` * `f32::from_str_radix` * `f64::from_str_radix` Closes #27277 Closes #27718 Closes #27736 Closes #27764 Closes #27765 Closes #27766 Closes #27767 Closes #27768 Closes #27769 Closes #27771 Closes #27773 Closes #27775 Closes #27776 Closes #27785 Closes #27792 Closes #27795 Closes #27797
2015-08-22Move the Borrow and BorrowMut traits to libcore.Simon Sapin-0/+8
2015-08-15alloc: Add issues for all unstable featuresAlex Crichton-6/+12
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-26/+0
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-08-11Register new snapshotsAlex Crichton-3/+0
* Lots of core prelude imports removed * Makefile support for MSVC env vars and Rust crates removed * Makefile support for morestack removed
2015-08-03syntax: Implement #![no_core]Alex Crichton-1/+2
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-07-30Auto merge of #27371 - Gankro:str-clone, r=alexcrichtonbors-0/+13
This is a minor [breaking-change], as it changes what `boxed_str.to_owned()` does (previously it would deref to `&str` and call `to_owned` on that to get a `String`). However `Box<str>` is such an exceptionally rare type that this is not expected to be a serious concern. Also a `Box<str>` can be freely converted to a `String` to obtain the previous result anyway.
2015-07-29implement Clone for Box<str>, closes #27323Alexis Beingessner-0/+13
This is a minor [breaking-change], as it changes what `boxed_str.to_owned()` does (previously it would deref to `&str` and call `to_owned` on that to get a `String`). However `Box<str>` is such an exceptionally rare type that this is not expected to be a serious concern. Also a `Box<str>` can be freely converted to a `String` to obtain the previous behaviour anyway.
2015-07-29Rollup merge of #27326 - steveklabnik:doc_show_use, r=GankroSteve Klabnik-4/+8
In spirit with https://internals.rust-lang.org/t/should-we-keep-including-obvious-imports-in-code-examples/2217, show the feature flags we're using in examples. (also one instance of 'use')
2015-07-28Auto merge of #26934 - reem:boxed-slice-clone, r=Gankrobors-1/+54
Closes #25097
2015-07-28Auto merge of #27309 - eddyb:snapshot-infdef, r=alexcrichtonbors-1/+1
FreeBSD i386 snapshot is missing, failed tests (possibly spurious). r? @alexcrichton
2015-07-28Implement Clone for Box<[T]> where T: CloneJonathan Reem-1/+54
Closes #25097
2015-07-27std: Deprecate a number of unstable featuresAlex Crichton-0/+3
Many of these have long since reached their stage of being obsolete, so this commit starts the removal process for all of them. The unstable features that were deprecated are: * cmp_partial * fs_time * hash_default * int_slice * iter_min_max * iter_reset_fuse * iter_to_vec * map_in_place * move_from * owned_ascii_ext * page_size * read_and_zero * scan_state * slice_chars * slice_position_elem * subslice_offset
2015-07-27Show appropriate feature flags in docsSteve Klabnik-4/+8
2015-07-27Turn on `box(PLACE) expr` deprecation warning post-snapshot.Eduard Burtescu-1/+1
2015-07-23fix doc-tests by opting into `placement_in_syntax` feature where necessary.Felix S. Klock II-1/+1
2015-07-22prototype Placer protocol for unstable overloaded-box and placement-in.Felix S. Klock II-5/+102
2015-07-17Add RawVec to unify raw Vecish codeAlexis Beingessner-1/+1
2015-07-13Update boxed.rsWei-Ming Yang-2/+2
Reverse PR `#26944 `, symbol `#` are actually as intended.
2015-07-11Update boxed.rsWei-Ming Yang-2/+2
fix typos
2015-06-26Use Box::into_raw rather than the deprecated boxed::into_raw in tests and ↵Ms2ger-4/+2
documentation.
2015-06-17Add comment about stabilizing CString::from_ptrAlex Crichton-0/+2
This naming needs to consider the raw vs ptr naming of Box/CStr/CString/slice/etc.
2015-06-17More test fixes and fallout of stability changesAlex Crichton-1/+1
2015-06-17std: Move free-functions to associated functionsAlex Crichton-3/+26
This commit moves the free functions in the `rc`, `arc`, and `boxed` modules to associated functions on their respective types, following the recent trend towards this pattern. The previous free functions are all left in-place with `#[deprecated]` pointers towards the new locations. This commit also deprecates `arc::get_mut` and `Arc::make_unique` with no replacement as they are racy in the face of weak pointers.
2015-06-17Fallout in tests and docs from feature renamingsAlex Crichton-4/+4