about summary refs log tree commit diff
path: root/src/libstd/lib.rs
AgeCommit message (Collapse)AuthorLines
2017-07-05rustc: Implement the #[global_allocator] attributeAlex Crichton-8/+6
This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/197 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
2017-06-20Rollup merge of #42271 - tinaun:charfromstr, r=alexcrichtonCorey Farwell-0/+1
add `FromStr` Impl for `char` fixes #24939. is it possible to use pub(restricted) instead of using a stability attribute for the internal error representation? is it needed at all?
2017-06-20added `FromStr` Impl for `char`tinaun-0/+1
2017-06-20Auto merge of #42313 - pnkfelix:allocator-integration, r=alexcrichtonbors-0/+1
Allocator integration Lets start getting some feedback on `trait Alloc`. Here is: * the `trait Alloc` itself, * the `struct Layout` and `enum AllocErr` that its API relies on * a `struct HeapAlloc` that exposes the system allocator as an instance of `Alloc` * an integration of `Alloc` with `RawVec` * ~~an integration of `Alloc` with `Vec`~~ TODO * [x] split `fn realloc_in_place` into `grow` and `shrink` variants * [x] add `# Unsafety` and `# Errors` sections to documentation for all relevant methods * [x] remove `Vec` integration with `Allocator` * [x] add `allocate_zeroed` impl to `HeapAllocator` * [x] remove typedefs e.g. `type Size = usize;` * [x] impl `trait Error` for all error types in PR * [x] make `Layout::from_size_align` public * [x] clarify docs of `fn padding_needed_for`. * [x] revise `Layout` constructors to ensure that [size+align combination is valid](https://github.com/rust-lang/rust/pull/42313#issuecomment-306845446) * [x] resolve mismatch re requirements of align on dealloc. See [comment](https://github.com/rust-lang/rust/pull/42313#issuecomment-306202489).
2017-06-16Introduce tidy lint to check for inconsistent tracking issuesest31-1/+1
This commit * Refactors the collect_lib_features function to work in a non-checking mode (no bad pointer needed, and list of lang features). * Introduces checking whether unstable/stable tags for a given feature have inconsistent tracking issues. * Fixes such inconsistencies throughout the codebase.
2017-06-15implement Error trait for error structs added in allocator API.Felix S. Klock II-0/+1
2017-06-13Merge crate `collections` into `alloc`Murarth-10/+7
2017-05-20migrate everything to using mem::needs_dropAlexis Beingessner-0/+1
2017-04-29Update stage0 bootstrap compilerAlex Crichton-1/+0
We've got a freshly minted beta compiler, let's update to use that on nightly! This has a few other changes associated with it as well * A bump to the rustc version number (to 1.19.0) * Movement of the `cargo` and `rls` submodules to their "proper" location in `src/tools/{cargo,rls}`. Now that Cargo workspaces support the `exclude` option this can work. * Updates of the `cargo` and `rls` submodules to their master branches. * Tweak to the `src/stage0.txt` format to be more amenable for Cargo version numbers. On the beta channel Cargo will bootstrap from a different version than rustc (e.g. the version numbers are different), so we need different configuration for this. * Addition of `dev` as a readable key in the `src/stage0.txt` format. If present then stage0 compilers are downloaded from `dev-static.rust-lang.org` instead of `static.rust-lang.org`. This is added to accomodate our updated release process with Travis and AppVeyor.
2017-04-20Remove float_extrasJosh Stone-1/+0
[unstable, deprecated since 1.11.0]
2017-04-20Remove num::{Zero,One}Josh Stone-1/+0
[unstable, deprecated since 1.11.0]
2017-04-20Remove RefCell::borrow_stateJosh Stone-1/+0
[unstable, deprecated since 1.15.0]
2017-04-18Override ToOwned::clone_into for Path and OsStrScott McMurray-0/+1
The only non-overridden one remaining is the CStr impl, which cannot be optimized as doing so would break CString's second invariant.
2017-04-18Add functions to safely transmute float to intest31-0/+1
2017-04-12Auto merge of #40765 - pirate:patch-3, r=aturonbors-0/+11
Add contribution instructions to stdlib docs Generally programming language docs have instructions on how to contribute changes. I couldn't find any in the rust docs, so I figured I'd add an instructions section, let me know if this belongs somewhere else!
2017-04-09Reduce str transmutes, add mut versions of methods.Clar Charr-0/+1
2017-04-07fix build errorsNick Sweeting-2/+3
2017-03-30tweak linksNick Sweeting-2/+2
2017-03-23add link to contribution guidelines and IRC roomNick Sweeting-3/+7
2017-03-23Add contribution instructions to stdlib docsNick Sweeting-0/+6
2017-03-20Rollup merge of #40556 - cramertj:stabilize-pub-restricted, r=petrochenkovCorey Farwell-1/+1
Stabilize pub(restricted) Fix https://github.com/rust-lang/rust/issues/32409
2017-03-20Fix up various linkssteveklabnik-5/+5
The unstable book, libstd, libcore, and liballoc all needed some adjustment.
2017-03-19Rollup merge of #40566 - clarcharr:never_error, r=sfacklerCorey Farwell-0/+1
Implement std::error::Error for !.
2017-03-17Stabilize rc_raw feature, closes #37197Aaron Turon-1/+0
2017-03-17Rollup merge of #40456 - frewsxcv:frewsxcv-docs-function-parens, ↵Corey Farwell-2/+2
r=GuillaumeGomez Remove function invokation parens from documentation links. This was never established as a convention we should follow in the 'More API Documentation Conventions' RFC: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-03-15Stabilize pub(restricted)Taylor Cramer-1/+1
2017-03-15Implement Error for !.Clar Charr-0/+1
2017-03-13Remove function invokation parens from documentation links.Corey Farwell-2/+2
This was never established as a convention we should follow in the 'More API Documentation Conventions' RFC: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-03-11Implement placement-in protocol for `HashMap`Charlie Fan-0/+1
2017-02-20Revert "Fix up links"Steve Klabnik-2/+2
This reverts commit 7f1d1c6d9a7be5e427bace30e740b16b25f25c92. The original commit was created because mdBook and rustdoc had different generation algorithms for header links; now with https://github.com/rust-lang/rust/pull/39966 , the algorithms are the same. So let's undo this change. ... when I came across this problem, I said "eh, this isn't fun, but it doesn't take that long." I probably should have just actually taken the time to fix upstream, given that they were amenable. Oh well!
2017-02-13Fix up linksSteve Klabnik-2/+2
mdbook and rustdoc generate links differently, so we need to change all these links.
2017-02-10Change std::panicking::try::Data into a unionwhataloadofwhat-0/+1
No longer potentially call `mem::uninitialized::<!>()` Fixes #39432
2017-02-07Rollup merge of #39431 - alexcrichton:no-more-makefiles, r=brsonCorey Farwell-3/+0
Delete the makefile build system This PR deletes the makefile build system in favor of the rustbuild build system. The beta has now been branched so 1.16 will continue to be buildable from the makefiles, but going forward 1.17 will only be buildable with rustbuild. Rustbuild has been the default build system [since 1.15.0](https://github.com/rust-lang/rust/pull/37817) and the makefiles were [proposed for deletion](https://internals.rust-lang.org/t/proposal-for-promoting-rustbuild-to-official-status/4368) at this time back in November of last year. And now with the deletion of these makefiles we can start getting those sweet sweet improvements of using crates.io crates in the compiler!
2017-02-06std: Remove cfg(cargobuild) annotationsAlex Crichton-3/+0
These are all now no longer needed that we've only got rustbuild in tree.
2017-02-05Ipv6Addr <-> u128Clar Charr-1/+2
2017-02-05Rollup merge of #38983 - APTy:udp-peek, r=aturonCorey Farwell-0/+1
Add peek APIs to std::net Adds "peek" APIs to `std::net` sockets, including: - `UdpSocket.peek()` - `UdpSocket.peek_from()` - `TcpStream.peek()` These methods enable socket reads without side-effects. That is, repeated calls to `peek()` return identical data. This is accomplished by providing the POSIX flag `MSG_PEEK` to the underlying socket read operations. This also moves the current implementation of `recv_from` out of the platform-independent `sys_common` and into respective `sys/windows` and `sys/unix` implementations. This allows for more platform-dependent implementations where necessary. Fixes #38980
2017-02-04libstd/net: Add `peek` APIs to UdpSocket and TcpStreamTyler Julian-0/+1
These methods enable socket reads without side-effects. That is, repeated calls to peek() return identical data. This is accomplished by providing the POSIX flag MSG_PEEK to the underlying socket read operations. This also moves the current implementation of recv_from out of the platform-independent sys_common and into respective sys/windows and sys/unix implementations. This allows for more platform-dependent implementations.
2017-02-03Bump version, upgrade bootstrapAlex Crichton-2/+0
This commit updates the version number to 1.17.0 as we're not on that version of the nightly compiler, and at the same time this updates src/stage0.txt to bootstrap from freshly minted beta compiler and beta Cargo.
2017-01-16Expose a feature to force use of alloc_system, teach rustbuildAidan Hobson Sayers-4/+5
This fixes jemalloc-less local rebuilds, where we tell cargo that we're actually stage1
2017-01-10Rollup merge of #38664 - apasel422:may-dangle, r=pnkfelixSeo Sanghyeon-1/+2
Replace uses of `#[unsafe_destructor_blind_to_params]` with `#[may_dangle]` CC #34761 r? @pnkfelix
2017-01-08Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrcbors-1/+1
Remove not(stage0) from deny(warnings) Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2016-12-30Such large. Very 128. Much bits.Simonas Kazlauskas-0/+7
This commit introduces 128-bit integers. Stage 2 builds and produces a working compiler which understands and supports 128-bit integers throughout. The general strategy used is to have rustc_i128 module which provides aliases for iu128, equal to iu64 in stage9 and iu128 later. Since nowhere in rustc we rely on large numbers being supported, this strategy is good enough to get past the first bootstrap stages to end up with a fully working 128-bit capable compiler. In order for this strategy to work, number of locations had to be changed to use associated max_value/min_value instead of MAX/MIN constants as well as the min_value (or was it max_value?) had to be changed to use xor instead of shift so both 64-bit and 128-bit based consteval works (former not necessarily producing the right results in stage1). This commit includes manual merge conflict resolution changes from a rebase by @est31.
2016-12-29Remove not(stage0) from deny(warnings)Alex Crichton-1/+1
Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2016-12-28Replace uses of `#[unsafe_destructor_blind_to_params]` with `#[may_dangle]`Andrew Paseltiner-1/+2
CC #34761
2016-12-18Implement `fmt::Debug` for all structures in libstd.Corey Farwell-0/+2
Part of https://github.com/rust-lang/rust/issues/31869. Also turn on the `missing_debug_implementations` lint at the crate level.
2016-12-12Auto merge of #38049 - frewsxcv:libunicode, r=alexcrichtonbors-2/+2
Rename 'librustc_unicode' crate to 'libstd_unicode'. Fixes https://github.com/rust-lang/rust/issues/26554.
2016-12-04std: Forward ExactSizeIterator::is_empty for Args, ArgsOs iteratorsUlrik Sverdrup-0/+1
2016-11-30Update the bootstrap compilerAlex Crichton-2/+0
Now that we've got a beta build, let's use it!
2016-11-30Rename 'librustc_unicode' crate to 'libstd_unicode'.Corey Farwell-2/+2
Fixes #26554.
2016-11-03Stabilize `..` in tuple (struct) patternsVadim Petrochenkov-1/+1