summary refs log tree commit diff
path: root/src/liballoc
AgeCommit message (Collapse)AuthorLines
2016-08-14Fix a couple of typos in RawVecIvan Ukhov-3/+3
2016-07-22std: Ignore tests where threads outlive mainAlex Crichton-1/+6
Long ago we discovered that threads which outlive main and then exit while the rest of the program is exiting causes Windows to hang (#20704). That's what was happening in this test so let's just not run this test any more.
2016-07-15Rollup merge of #34733 - izgzhen:alloc-arc-doc-improve, r=steveklabnikGuillaume Gomez-43/+46
Improve arc doc, fixing #32905 As issue #32905 detailed, I moved part of the module doc to the struct doc, and fixed some small places in the `alloc::arc`.
2016-07-12Rollup merge of #34740 - GuillaumeGomez:boxed_doc, r=steveklabnikGuillaume Gomez-3/+46
Improve boxed docs Fixes #29343. r? @steveklabnik
2016-07-12Improve arc doc, fixing #32905Zhen Zhang-43/+46
2016-07-11Improve boxed docsGuillaume Gomez-3/+46
2016-07-08Rollup merge of #34097 - arbitrary-cat:master, r=steveklabnikManish Goregaokar-1/+2
Revise wording in Rc documentation. The term "thread-local" has a widely accepted meaning which is not the meaning it's used for here.
2016-07-07Changed wording per aturon's comments.Sam Payson-1/+2
2016-06-05Update rc.rsFrank McSherry-1/+1
The original description suggests that the original `Rc<T>` itself is downgraded, which doesn't seem to be what the code does. At the same time, `Rc` is one of those types that can do weird things with only a shared reference, so I thought it would be good to be clear.
2016-06-05Revise wording in Rc documentation.Sam Payson-1/+1
The term "thread-local" has a widely-accepted meaning which is not the meaning it's used for here.
2016-06-03Auto merge of #33460 - shepmaster:16-bit-pointers, r=Aatchbors-3/+3
Support 16-bit pointers as well as i/usize I'm opening this pull request to get some feedback from the community. Although Rust doesn't support any platforms with a native 16-bit pointer at the moment, the [AVR-Rust][ar] fork is working towards that goal. Keeping this forked logic up-to-date with the changes in master has been onerous so I'd like to merge these changes so that they get carried along when refactoring happens. I do not believe this should increase the maintenance burden. This is based on the original work of Dylan McKay (@dylanmckay). [ar]: https://github.com/avr-rust/rust
2016-05-28rustfmt liballoc folderSrinivas Reddy Thatiparthy-17/+22
2016-05-24std: Stabilize APIs for the 1.10 releaseAlex Crichton-58/+63
This commit applies the FCP decisions made by the libs team for the 1.10 cycle, including both new stabilizations and deprecations. Specifically, the list of APIs is: Stabilized: * `os::windows::fs::OpenOptionsExt::access_mode` * `os::windows::fs::OpenOptionsExt::share_mode` * `os::windows::fs::OpenOptionsExt::custom_flags` * `os::windows::fs::OpenOptionsExt::attributes` * `os::windows::fs::OpenOptionsExt::security_qos_flags` * `os::unix::fs::OpenOptionsExt::custom_flags` * `sync::Weak::new` * `Default for sync::Weak` * `panic::set_hook` * `panic::take_hook` * `panic::PanicInfo` * `panic::PanicInfo::payload` * `panic::PanicInfo::location` * `panic::Location` * `panic::Location::file` * `panic::Location::line` * `ffi::CStr::from_bytes_with_nul` * `ffi::CStr::from_bytes_with_nul_unchecked` * `ffi::FromBytesWithNulError` * `fs::Metadata::modified` * `fs::Metadata::accessed` * `fs::Metadata::created` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak` * `collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key` * `os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}` * `SocketAddr::is_unnamed` * `SocketAddr::as_pathname` * `UnixStream::connect` * `UnixStream::pair` * `UnixStream::try_clone` * `UnixStream::local_addr` * `UnixStream::peer_addr` * `UnixStream::set_read_timeout` * `UnixStream::set_write_timeout` * `UnixStream::read_timeout` * `UnixStream::write_Timeout` * `UnixStream::set_nonblocking` * `UnixStream::take_error` * `UnixStream::shutdown` * Read/Write/RawFd impls for `UnixStream` * `UnixListener::bind` * `UnixListener::accept` * `UnixListener::try_clone` * `UnixListener::local_addr` * `UnixListener::set_nonblocking` * `UnixListener::take_error` * `UnixListener::incoming` * RawFd impls for `UnixListener` * `UnixDatagram::bind` * `UnixDatagram::unbound` * `UnixDatagram::pair` * `UnixDatagram::connect` * `UnixDatagram::try_clone` * `UnixDatagram::local_addr` * `UnixDatagram::peer_addr` * `UnixDatagram::recv_from` * `UnixDatagram::recv` * `UnixDatagram::send_to` * `UnixDatagram::send` * `UnixDatagram::set_read_timeout` * `UnixDatagram::set_write_timeout` * `UnixDatagram::read_timeout` * `UnixDatagram::write_timeout` * `UnixDatagram::set_nonblocking` * `UnixDatagram::take_error` * `UnixDatagram::shutdown` * RawFd impls for `UnixDatagram` * `{BTree,Hash}Map::values_mut` * `<[_]>::binary_search_by_key` Deprecated: * `StaticCondvar` - this, and all other static synchronization primitives below, are usable today through the lazy-static crate on stable Rust today. Additionally, we'd like the non-static versions to be directly usable in a static context one day, so they're unlikely to be the final forms of the APIs in any case. * `CONDVAR_INIT` * `StaticMutex` * `MUTEX_INIT` * `StaticRwLock` * `RWLOCK_INIT` * `iter::Peekable::is_empty` Closes #27717 Closes #27720 cc #27784 (but encode methods still exist) Closes #30014 Closes #30425 Closes #30449 Closes #31190 Closes #31399 Closes #31767 Closes #32111 Closes #32281 Closes #32312 Closes #32551 Closes #33018
2016-05-19Support 16-bit pointers as well as i/usizeJake Goulding-3/+3
This is based on the original work of Dylan McKay for the [avr-rust project][ar]. [ar]: https://github.com/avr-rust/rust
2016-05-15Rollup merge of #33590 - durka:patch-22, r=aturonManish Goregaokar-4/+8
update "reason" for fnbox feature gate It isn't "newly introduced" anymore.
2016-05-12Auto merge of #33282 - alexcrichton:rustbuild-crate-tests, r=brsonbors-1/+0
rustbuild: Add support for crate tests + doctests This commit adds support to rustbuild to run crate unit tests (those defined by `#[test]`) as well as documentation tests. All tests are powered by `cargo test` under the hood. Each step requires the `libtest` library is built for that corresponding stage. Ideally the `test` crate would be a dev-dependency, but for now it's just easier to ensure that we sequence everything in the right order. Currently no filtering is implemented, so there's not actually a method of testing *only* libstd or *only* libcore, but rather entire swaths of crates are tested all at once. A few points of note here are: * The `coretest` and `collectionstest` crates are just listed as `[[test]]` entires for `cargo test` to naturally pick up. This mean that `cargo test -p core` actually runs all the tests for libcore. * Libraries that aren't tested all mention `test = false` in their `Cargo.toml` * Crates aren't currently allowed to have dev-dependencies due to rust-lang/cargo#860, but we can likely alleviate this restriction once workspaces are implemented. cc #31590
2016-05-12rustbuild: Add support for crate tests + doctestsAlex Crichton-1/+0
This commit adds support to rustbuild to run crate unit tests (those defined by `#[test]`) as well as documentation tests. All tests are powered by `cargo test` under the hood. Each step requires the `libtest` library is built for that corresponding stage. Ideally the `test` crate would be a dev-dependency, but for now it's just easier to ensure that we sequence everything in the right order. Currently no filtering is implemented, so there's not actually a method of testing *only* libstd or *only* libcore, but rather entire swaths of crates are tested all at once. A few points of note here are: * The `coretest` and `collectionstest` crates are just listed as `[[test]]` entires for `cargo test` to naturally pick up. This mean that `cargo test -p core` actually runs all the tests for libcore. * Libraries that aren't tested all mention `test = false` in their `Cargo.toml` * Crates aren't currently allowed to have dev-dependencies due to rust-lang/cargo#860, but we can likely alleviate this restriction once workspaces are implemented. cc #31590
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-05-09Inline RawVec::capMatt Brubeck-0/+1
2016-04-07Rollup merge of #32741 - tbu-:pr_remove_fixme_12808, r=blussManish Goregaokar-47/+39
Remove strange names created by lack of privacy-conscious name lookup The fixed issue that allowed this was #12808.
2016-04-05Fix infinite loop in Arc::downgradeAmanieu d'Antras-0/+1
2016-04-05Remove strange names created by lack of privacy-conscious name lookupTobias Bucher-47/+39
The fixed issue that allowed this was #12808.
2016-03-31Change Arc to use compare_exchange instead of compare_and_swapAmanieu d'Antras-17/+21
2016-03-28Rollup merge of #32177 - srinivasreddy:remove_integer_suffixes, r=steveklabnikSteve Klabnik-6/+6
first round of removal of integer suffixes
2016-03-11alloc: Add unstable issue for FnBox APIsAlex Crichton-4/+4
2016-03-10first round of removal of integer suffixessrinivasreddy-6/+6
2016-03-10Rollup merge of #32147 - steveklabnik:gh31950, r=blussSteve Klabnik-4/+6
Clarify that try_unwrap needs exactly one Fixes #31950
2016-03-09Clarify that try_unwrap needs exactly oneSteve Klabnik-4/+6
Fixes #31950
2016-03-07mk: Distribute fewer TARGET_CRATESAlex Crichton-4/+1
Right now everything in TARGET_CRATES is built by default for all non-fulldeps tests and is distributed by default for all target standard library packages. Currenly this includes a number of unstable crates which are rarely used such as `graphviz` and `rbml`> This commit trims down the set of `TARGET_CRATES`, moves a number of tests to `*-fulldeps` as a result, and trims down the dependencies of libtest so we can distribute fewer crates in the `rust-std` packages.
2016-02-29std: Stabilize APIs for the 1.8 releaseAlex Crichton-1/+0
This commit is the result of the FCPs ending for the 1.8 release cycle for both the libs and the lang suteams. The full list of changes are: Stabilized * `braced_empty_structs` * `augmented_assignments` * `str::encode_utf16` - renamed from `utf16_units` * `str::EncodeUtf16` - renamed from `Utf16Units` * `Ref::map` * `RefMut::map` * `ptr::drop_in_place` * `time::Instant` * `time::SystemTime` * `{Instant,SystemTime}::now` * `{Instant,SystemTime}::duration_since` - renamed from `duration_from_earlier` * `{Instant,SystemTime}::elapsed` * Various `Add`/`Sub` impls for `Time` and `SystemTime` * `SystemTimeError` * `SystemTimeError::duration` * Various impls for `SystemTimeError` * `UNIX_EPOCH` * `ops::{Add,Sub,Mul,Div,Rem,BitAnd,BitOr,BitXor,Shl,Shr}Assign` Deprecated * Scoped TLS (the `scoped_thread_local!` macro) * `Ref::filter_map` * `RefMut::filter_map` * `RwLockReadGuard::map` * `RwLockWriteGuard::map` * `Condvar::wait_timeout_with` Closes #27714 Closes #27715 Closes #27746 Closes #27748 Closes #27908 Closes #29866
2016-02-21Fix liballoc dependenciesJohn Kåre Alsaker-9/+0
2016-02-11bootstrap: Add a bunch of Cargo.toml filesAlex Crichton-0/+14
These describe the structure of all our crate dependencies.
2016-02-11Auto merge of #31479 - kamalmarhubi:fmt-pointer-unsized, r=alexcrichtonbors-3/+3
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-02-08Auto merge of #31397 - bradfirj:arc-docfix, r=steveklabnikbors-3/+3
The documentation for the `make_mut` function on `Arc<T>` contains a somewhat impenetrable double-negative that I was only able to fully grasp by looking at the implementation. Here's a quick rewrite that reads a lot better. The sentence "doesn't have one strong reference and no weak references." is a hard to understand, and it can be much more easily explained. In particular, such a double-negative could give English as a Second Language users even more trouble than native speakers. r? @steveklabnik
2016-02-08Implement fmt::Pointer for pointers to unsized typesKamal Marhubi-3/+3
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-02-04Synthesize calls to box_free language itemSimonas Kazlauskas-0/+13
This gets rid of Drop(Free, _) MIR construct by synthesizing a call to language item which takes care of dropping instead.
2016-02-04Fix unclear make_mut docsRichard Bradfield-3/+3
Changed the description of the `make_mut` copy-on-write behaviour in arc.rs The sentence "doesn't have one strong reference and no weak references." is a hard to understand double negative, which can be much more easily explained.
2016-01-26Fix warnings during testsAlex Crichton-9/+5
The deny(warnings) attribute is now enabled for tests so we need to weed out these warnings as well.
2016-01-24mk: Move from `-D warnings` to `#![deny(warnings)]`Alex Crichton-0/+1
This commit removes the `-D warnings` flag being passed through the makefiles to all crates to instead be a crate attribute. We want these attributes always applied for all our standard builds, and this is more amenable to Cargo-based builds as well. Note that all `deny(warnings)` attributes are gated with a `cfg(stage0)` attribute currently to match the same semantics we have today
2016-01-21Auto merge of #31043 - shahn:arc_weak, r=alexcrichtonbors-4/+4
This was accidentally introduced in 7e2ffc7090a70fe8c77a0e03fcec3cb1387141f2, b44ee371b8beea77aa1364460acbba14a8516559 and 36ba96ea3cfef575ddc5eea7754a1b70b50e2080.
2016-01-20Fix incorrect stability annotations for arc::WeakSebastian Hahn-4/+4
This was accidentally introduced in 7e2ffc7090a70fe8c77a0e03fcec3cb1387141f2, b44ee371b8beea77aa1364460acbba14a8516559 and 36ba96ea3cfef575ddc5eea7754a1b70b50e2080.
2016-01-20Fix incorrect stability annotations for WeakSebastian Hahn-4/+4
This was accidentally introduced in 7e2ffc7090a70fe8c77a0e03fcec3cb1387141f2.
2016-01-16std: Stabilize APIs for the 1.7 releaseAlex Crichton-3/+1
This commit stabilizes and deprecates the FCP (final comment period) APIs for the upcoming 1.7 beta release. The specific APIs which changed were: Stabilized * `Path::strip_prefix` (renamed from `relative_from`) * `path::StripPrefixError` (new error type returned from `strip_prefix`) * `Ipv4Addr::is_loopback` * `Ipv4Addr::is_private` * `Ipv4Addr::is_link_local` * `Ipv4Addr::is_multicast` * `Ipv4Addr::is_broadcast` * `Ipv4Addr::is_documentation` * `Ipv6Addr::is_unspecified` * `Ipv6Addr::is_loopback` * `Ipv6Addr::is_unique_local` * `Ipv6Addr::is_multicast` * `Vec::as_slice` * `Vec::as_mut_slice` * `String::as_str` * `String::as_mut_str` * `<[T]>::clone_from_slice` - the `usize` return value is removed * `<[T]>::sort_by_key` * `i32::checked_rem` (and other signed types) * `i32::checked_neg` (and other signed types) * `i32::checked_shl` (and other signed types) * `i32::checked_shr` (and other signed types) * `i32::saturating_mul` (and other signed types) * `i32::overflowing_add` (and other signed types) * `i32::overflowing_sub` (and other signed types) * `i32::overflowing_mul` (and other signed types) * `i32::overflowing_div` (and other signed types) * `i32::overflowing_rem` (and other signed types) * `i32::overflowing_neg` (and other signed types) * `i32::overflowing_shl` (and other signed types) * `i32::overflowing_shr` (and other signed types) * `u32::checked_rem` (and other unsigned types) * `u32::checked_neg` (and other unsigned types) * `u32::checked_shl` (and other unsigned types) * `u32::saturating_mul` (and other unsigned types) * `u32::overflowing_add` (and other unsigned types) * `u32::overflowing_sub` (and other unsigned types) * `u32::overflowing_mul` (and other unsigned types) * `u32::overflowing_div` (and other unsigned types) * `u32::overflowing_rem` (and other unsigned types) * `u32::overflowing_neg` (and other unsigned types) * `u32::overflowing_shl` (and other unsigned types) * `u32::overflowing_shr` (and other unsigned types) * `ffi::IntoStringError` * `CString::into_string` * `CString::into_bytes` * `CString::into_bytes_with_nul` * `From<CString> for Vec<u8>` * `From<CString> for Vec<u8>` * `IntoStringError::into_cstring` * `IntoStringError::utf8_error` * `Error for IntoStringError` Deprecated * `Path::relative_from` - renamed to `strip_prefix` * `Path::prefix` - use `components().next()` instead * `os::unix::fs` constants - moved to the `libc` crate * `fmt::{radix, Radix, RadixFmt}` - not used enough to stabilize * `IntoCow` - conflicts with `Into` and may come back later * `i32::{BITS, BYTES}` (and other integers) - not pulling their weight * `DebugTuple::formatter` - will be removed * `sync::Semaphore` - not used enough and confused with system semaphores Closes #23284 cc #27709 (still lots more methods though) Closes #27712 Closes #27722 Closes #27728 Closes #27735 Closes #27729 Closes #27755 Closes #27782 Closes #27798
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-14Rollup merge of #30892 - shepmaster:box-grammar, r=alexcrichtonManish Goregaokar-14/+14