summary refs log tree commit diff
path: root/src/libstd/lib.rs
AgeCommit message (Collapse)AuthorLines
2015-09-14Auto merge of #28358 - dotdash:nounwind, r=alexcrichtonbors-0/+1
This allows to skip the codegen for all the unneeded landing pads, reducing code size across the board by about 2-5%, depending on the crate. Compile times seem to be pretty unaffected though :-/
2015-09-14Mark all extern functions as nounwindBjörn Steinbrink-0/+1
Unwinding across an FFI boundary is undefined behaviour, so we can mark all external function as nounwind. The obvious exception are those functions that actually perform the unwinding.
2015-09-11std: Stabilize/deprecate features for 1.4Alex Crichton-1/+0
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-23Refactor low-level UTF-16 decoding.Simon Sapin-0/+1
* Rename `utf16_items` to `decode_utf16`. "Items" is meaningless. * Move it to `rustc_unicode::char`, exposed in `std::char`. * Generalize it to any `u16` iterable, not just `&[u16]`. * Make it yield `Result` instead of a custom `Utf16Item` enum that was isomorphic to `Result`. This enable using the `FromIterator for Result` impl. * Add a `REPLACEMENT_CHARACTER` constant. * Document how `result.unwrap_or(REPLACEMENT_CHARACTER)` replaces `Utf16Item::to_char_lossy`.
2015-08-22Auto merge of #27871 - alexcrichton:stabilize-libcore, r=aturonbors-29/+16
These commits move libcore into a state so that it's ready for stabilization, performing some minor cleanup: * The primitive modules for integers in the standard library were all removed from the source tree as they were just straight reexports of the libcore variants. * The `core::atomic` module now lives in `core::sync::atomic`. The `core::sync` module is otherwise empty, but ripe for expansion! * The `core::prelude::v1` module was stabilized after auditing that it is a subset of the standard library's prelude plus some primitive extension traits (char, str, and slice) * Some unstable-hacks for float parsing errors were shifted around to not use the same unstable hacks (e.g. the `flt2dec` module is now used for "privacy"). After this commit, the remaining large unstable functionality specific to libcore is: * `raw`, `intrinsics`, `nonzero`, `array`, `panicking`, `simd` -- these modules are all unstable or not reexported in the standard library, so they're just remaining in the same status quo as before * `num::Float` - this extension trait for floats needs to be audited for functionality (much of that is happening in #27823) and may also want to be renamed to `FloatExt` or `F32Ext`/`F64Ext`. * Should the extension traits for primitives be stabilized in libcore? I believe other unstable pieces are not isolated to just libcore but also affect the standard library. cc #27701
2015-08-22Auto merge of #27860 - m4rw3r:rustdoc_unstable_feature_issue, r=alexcrichtonbors-0/+1
Implemented #27759 Example: ![screen shot 2015-08-16 at 21 45 17](https://cloud.githubusercontent.com/assets/108100/9295040/1fb24d50-4460-11e5-8ab8-81ac5330974a.png)
2015-08-17switch core::simd to repr(simd) and deprecate it.Huon Wilson-0/+1
This functionality will be available out of tree in the `simd` crate on crates.io. [breaking-change]
2015-08-17std: Clean up primitive integer modulesAlex Crichton-29/+16
All of the modules in the standard library were just straight reexports of those in libcore, so remove all the "macro modules" from the standard library and just reexport what's in core directly.
2015-08-16rustdoc: Added issue_tracker_base_url annotations to cratesMartin Wernstål-0/+1
2015-08-15std: Add issues to all unstable featuresAlex Crichton-1/+1
2015-08-14rustc: Allow changing the default allocatorAlex Crichton-2/+0
This commit is an implementation of [RFC 1183][rfc] which allows swapping out the default allocator on nightly Rust. No new stable surface area should be added as a part of this commit. [rfc]: https://github.com/rust-lang/rfcs/pull/1183 Two new attributes have been added to the compiler: * `#![needs_allocator]` - this is used by liballoc (and likely only liballoc) to indicate that it requires an allocator crate to be in scope. * `#![allocator]` - this is a indicator that the crate is an allocator which can satisfy the `needs_allocator` attribute above. The ABI of the allocator crate is defined to be a set of symbols that implement the standard Rust allocation/deallocation functions. The symbols are not currently checked for exhaustiveness or typechecked. There are also a number of restrictions on these crates: * An allocator crate cannot transitively depend on a crate that is flagged as needing an allocator (e.g. allocator crates can't depend on liballoc). * There can only be one explicitly linked allocator in a final image. * If no allocator is explicitly requested one will be injected on behalf of the compiler. Binaries and Rust dylibs will use jemalloc by default where available and staticlibs/other dylibs will use the system allocator by default. Two allocators are provided by the distribution by default, `alloc_system` and `alloc_jemalloc` which operate as advertised. Closes #27389
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-2/+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-11rollup merge of #27678: alexcrichton/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-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-09Use https URLs to refer to rust-lang.org where appropriate.Eli Friedman-3/+3
Also fixes a few outdated links.
2015-08-04syntax: Don't assume `std` exists for testsAlex Crichton-8/+0
This commit removes the injection of `std::env::args()` from `--test` expanded code, relying on the test runner itself to call this funciton. This is more hygienic because we can't assume that `std` exists at the top layer all the time, and it meaks the injected test module entirely self contained.
2015-08-03syntax: Implement #![no_core]Alex Crichton-3/+7
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-08-02std: Tighten up crate docsBrian Anderson-11/+6
2015-07-31trpl: fix link errorFuGangqiang-1/+1
2015-07-30Auto merge of #27388 - alexcrichton:remove-curious-inner, r=brsonbors-22/+5
This isn't actually necessary any more with the advent of `$crate` and changes in the compiler to expand macros to `::core::$foo` in the context of a `#![no_std]` crate. The libcore inner module was also trimmed down a bit to the bare bones.
2015-07-29std: Remove the curious inner moduleAlex Crichton-22/+5
This isn't actually necessary any more with the advent of `$crate` and changes in the compiler to expand macros to `::core::$foo` in the context of a `#![no_std]` crate. The libcore inner module was also trimmed down a bit to the bare bones.
2015-07-30Rollup merge of #27369 - brson:realstd, r=alexcrichtonManish Goregaokar-10/+5
Since most lang items are actually defined in core, these hack reexports don't actually do anything useful.
2015-07-28std: Remove some old #[cfg(test) hacksBrian Anderson-10/+5
Since most lang items are actually defined in core, these hack reexports don't actually do anything useful.
2015-07-28Auto merge of #27309 - eddyb:snapshot-infdef, r=alexcrichtonbors-1/+0
FreeBSD i386 snapshot is missing, failed tests (possibly spurious). r? @alexcrichton
2015-07-27std: Deprecate a number of unstable featuresAlex Crichton-1/+0
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-27Register new snapshots (2015-07-26 a5c12f4).Eduard Burtescu-1/+0
2015-07-25Auto merge of #27233 - tbu-:pr_wtf8, r=alexcrichtonbors-0/+1
2015-07-24Add unstable attribute to `char::from_u32_unchecked`Tobias Bucher-0/+1
2015-07-22Avoid feature-warnings on stage0.Felix S. Klock II-0/+1
2015-07-22Add feature-gates for desugaring-based `box` and placement-`in`.Felix S. Klock II-0/+1
update test/compile-fail/feature-gate-box-expr.rs to reflect new feature gates. Part of what lands with Issue 22181.
2015-07-20Address feedbackBrian Anderson-3/+3
2015-07-20std: Create separate docs for the primitivesBrian Anderson-6/+4
Having the primitive and module docs derived from the same source causes problems, primarily that they can't contain hyperlinks cross-referencing each other. This crates dedicated private modules in `std` to document the primitive types, then for all primitives that have a corresponding module, puts hyperlinks in moth the primitive docs and the module docs cross-linking each other. This should help clear up confusion when readers find themselves on the wrong page.
2015-07-16Rollup merge of #26977 - brson:stddoc, r=GankroManish Goregaokar-28/+128
Yet another attempt to make the prose on the std crate page clearer and more informative. This does a lot of things: tightens up the opening, adds useful links (including a link to the search bar), offers guidance on how to use the docs, and expands the prelude docs as a useful newbie entrypoint. r? @steveklabnik cc @aturon
2015-07-14Address more feedbackBrian Anderson-3/+3
2015-07-14Address more feedbackBrian Anderson-4/+5
2015-07-14Use Vec::drain in BufWriterUlrik Sverdrup-0/+1
I happened past a comment that asked for functionality that we now have.
2015-07-13Address feedbackBrian Anderson-31/+35
2015-07-13Fix local pathBrian Anderson-1/+1
2015-07-13std: Refining crate docsBrian Anderson-26/+121
Yet another attempt to make the prose on the std crate page clearer and more informative. This does a lot of things: tightens up the opening, adds useful links (including a link to the search bar), offers guidance on how to use the docs, and expands the prelude docs as a useful newbie entrypoint.
2015-07-09Test that CStr and CString have equivalent hashes.Jonathan Reem-1/+1
2015-07-08Improve Vec::resize so that it can be used in Read::read_to_endUlrik Sverdrup-0/+1
We needed a more efficient way to zerofill the vector in read_to_end. This to reduce the memory intialization overhead to a minimum. Use the implementation of `std::vec::from_elem` (used for the vec![] macro) for Vec::resize as well. For simple element types like u8, this compiles to memset, so it makes Vec::resize much more efficient.
2015-07-01msvc: Fix TLS destructorsAlex Crichton-0/+1
Just like the original article our Windows TLS support is based on predicted, this symbol must be linked in on MSVC to pull in the necessary support for TLS variables. This commit fixes a number of unit tests which require that TLS destructors are run.
2015-06-24Fix capitalization in std docsBrian Anderson-1/+1
"Rust" and "The Rust Standard Library" are capitalized.
2015-06-22sys/unix/c.rs: Remove unused codeGeoffrey Thomas-2/+0
It looks like a lot of this dated to previous incarnations of the io module, etc., and went unused in the reworking leading up to 1.0. Remove everything we're not actively using (except for signal handling, which will be reworked in the next commit).
2015-06-18Fix libstd testsAlex Crichton-1/+4
2015-06-17More test fixes and fallout of stability changesAlex Crichton-1/+0
2015-06-17Fallout in tests and docs from feature renamingsAlex Crichton-2/+2
2015-06-17std: Split the `std_misc` featureAlex Crichton-1/+1
2015-06-17collections: Split the `collections` featureAlex Crichton-0/+5
This commit also deprecates the `as_string` and `as_slice` free functions in the `string` and `vec` modules.
2015-06-17alloc: Split apart the global `alloc` featureAlex Crichton-0/+3