about summary refs log tree commit diff
path: root/src/libstd/lib.rs
AgeCommit message (Collapse)AuthorLines
2015-03-23rollup merge of #23598: brson/gateAlex Crichton-1/+2
Conflicts: src/compiletest/compiletest.rs src/libcollections/lib.rs src/librustc_back/lib.rs src/libserialize/lib.rs src/libstd/lib.rs src/libtest/lib.rs src/test/run-make/rustdoc-default-impl/foo.rs src/test/run-pass/env-home-dir.rs
2015-03-23rollup merge of #23641: steveklabnik/gh23632Alex Crichton-5/+5
Fixes #23632
2015-03-23rollup merge of #23634: WiSaGaN/bugfix/fix_dead_linkAlex Crichton-1/+1
2015-03-23rollup merge of #23633: tomjakubowski/rustdoc-array-primAlex Crichton-1/+5
Previously, impls for `[T; n]` were collected in the same place as impls for `[T]` and `&[T]`. This splits them out into their own primitive page in both core and std.
2015-03-23rollup merge of #23557: aturon/rfc-909Alex Crichton-15/+8
This commit implements [RFC 909](https://github.com/rust-lang/rfcs/pull/909): The `std::thread_local` module is now deprecated, and its contents are available directly in `std::thread` as `LocalKey`, `LocalKeyState`, and `ScopedKey`. The macros remain exactly as they were, which means little if any code should break. Nevertheless, this is technically a: [breaking-change] Closes #23547
2015-03-23Add generic conversion traitsAaron Turon-0/+3
This commit: * Introduces `std::convert`, providing an implementation of RFC 529. * Deprecates the `AsPath`, `AsOsStr`, and `IntoBytes` traits, all in favor of the corresponding generic conversion traits. Consequently, various IO APIs now take `AsRef<Path>` rather than `AsPath`, and so on. Since the types provided by `std` implement both traits, this should cause relatively little breakage. * Deprecates many `from_foo` constructors in favor of `from`. * Changes `PathBuf::new` to take no argument (creating an empty buffer, as per convention). The previous behavior is now available as `PathBuf::from`. * De-stabilizes `IntoCow`. It's not clear whether we need this separate trait. Closes #22751 Closes #14433 [breaking-change]
2015-03-23Add #![feature] attributes to doctestsBrian Anderson-0/+1
2015-03-23Require feature attributes, and add them where necessaryBrian Anderson-1/+1
2015-03-23rustdoc: Support for "array" primitiveTom Jakubowski-1/+5
Impls on `clean::Type::FixedVector` are now collected in the array primitive page instead of the slice primitive page. Also add a primitive docs for arrays to `std`.
2015-03-23Implement RFC 909: move thread_local into threadAaron Turon-15/+8
This commit implements [RFC 909](https://github.com/rust-lang/rfcs/pull/909): The `std::thread_local` module is now deprecated, and its contents are available directly in `std::thread` as `LocalKey`, `LocalKeyState`, and `ScopedKey`. The macros remain exactly as they were, which means little if any code should break. Nevertheless, this is technically a: [breaking-change] Closes #23547
2015-03-23Clarify that slices don't just point to arraysSteve Klabnik-5/+5
Fixes #23632
2015-03-23Fix dead link for std::sync::mpsc.Wangshan Lu-1/+1
2015-03-18Rollup merge of #23392 - WiSaGaN:bugfix/fix_deprecate_link, r=ManishearthManish Goregaokar-4/+4
Since module `std::sync::mpsc` is stable now, fix the deprecated link `comm` with `sync::mpsc`.
2015-03-17std: Tweak some unstable features of `str`Alex Crichton-0/+1
This commit clarifies some of the unstable features in the `str` module by moving them out of the blanket `core` and `collections` features. The following methods were moved to the `str_char` feature which generally encompasses decoding specific characters from a `str` and dealing with the result. It is unclear if any of these methods need to be stabilized for 1.0 and the most conservative route for now is to continue providing them but to leave them as unstable under a more specific name. * `is_char_boundary` * `char_at` * `char_range_at` * `char_at_reverse` * `char_range_at_reverse` * `slice_shift_char` The following methods were moved into the generic `unicode` feature as they are specifically enabled by the `unicode` crate itself. * `nfd_chars` * `nfkd_chars` * `nfc_chars` * `graphemes` * `grapheme_indices` * `width`
2015-03-15Fix deprecated `comm` link.Wangshan Lu-4/+4
2015-03-13Fallout of std::old_io deprecationAlex Crichton-0/+1
2015-03-12std: Remove #[allow] directives in sys modulesAlex Crichton-2/+3
These were suppressing lots of interesting warnings! Turns out there was also quite a bit of dead code.
2015-03-06Rollup merge of #23056 - awlnx:master, r=nrcManish Goregaokar-1/+2
2015-03-05fix for new attributes failing. issue #22964awlnx-1/+2
2015-03-06Use `#[allow_internal_unstable]` for `thread_local!`Huon Wilson-0/+1
This destabilises all the implementation details of `thread_local!`, since they do not *need* to be stable with the new attribute.
2015-03-04Auto merge of #22920 - tshepang:remove-some-warnings, r=huonwbors-1/+1
2015-03-02Readd int_uint feature to libstdSimonas Kazlauskas-0/+1
Reverts a small part of c74d49c804c3 because compilation pukes with warnings now.
2015-03-01Remove int/uint from libstd/lib.rsGuillaume Gomez-2/+0
2015-03-01remove some compiler warningsTshepang Lekhonkhobe-1/+1
2015-03-01Fix errors, remove unused filesGuillaumeGomez-1/+1
2015-02-24std: Stabilize some `ptr` functionsAlex Crichton-0/+1
Specifically, the following actions were taken: * The `copy_memory` and `copy_nonoverlapping_memory` functions to drop the `_memory` suffix (as it's implied by the functionality). Both functions are now marked as `#[stable]`. * The `set_memory` function was renamed to `write_bytes` and is now stable. * The `zero_memory` function is now deprecated in favor of `write_bytes` directly. * The `Unique` pointer type is now behind its own feature gate called `unique` to facilitate future stabilization. * All type parameters now are `T: ?Sized` wherever possible and new clauses were added to the `offset` functions to require that the type is sized. [breaking-change]
2015-02-23Test fixes and rebase conflictsAlex Crichton-0/+1
2015-02-20make int/uint modules just re-exportsAlexis-2/+2
2015-02-20try to reduce bajillion warningsAlexis-2/+1
2015-02-18Stabilize std::borrowAaron Turon-1/+1
This commit stabilizes `std::borrow`, making the following modifications to catch up the API with language changes: * It renames `BorrowFrom` to `Borrow`, as was originally intended (but blocked for technical reasons), and reorders the parameters accordingly. * It moves the type parameter of `ToOwned` to an associated type. This is somewhat less flexible, in that each borrowed type must have a unique owned type, but leads to a significant simplification for `Cow`. Flexibility can be regained by using newtyped slices, which is advisable for other reasons anyway. * It removes the owned type parameter from `Cow`, making the type much less verbose. * Deprecates the `is_owned` and `is_borrowed` predicates in favor of direct matching. The above API changes are relatively minor; the basic functionality remains the same, and essentially the whole module is now marked `#[stable]`. [breaking-change]
2015-02-17Register new snapshotsAlex Crichton-10/+0
2015-02-15Rollup merge of #22347 - iKevinY:std-lib-panicking, r=brsonManish Goregaokar-1/+1
Rename `libstd/failure.rs` to `libstd/panicking.rs` and `on_fail` to `on_panic`. Closes #22306.
2015-02-13Add std::processAaron Turon-0/+1
Per [RFC 579](https://github.com/rust-lang/rfcs/pull/579), this commit adds a new `std::process` module. This module is largely based on the existing `std::old_io::process` module, but refactors the API to use `OsStr` and other new standards set out by IO reform. The existing module is not yet deprecated, to allow for the new API to get a bit of testing before a mass migration to it.
2015-02-13Rename std::failure to std::panickingKevin Yap-1/+1
Closes #22306.
2015-02-11rollup merge of #22015: alexcrichton/netv2Alex Crichton-0/+1
This commit is an implementation of [RFC 807][rfc] which adds a `std::net` module for basic neworking based on top of `std::io`. This module serves as a replacement for the `std::old_io::net` module and networking primitives in `old_io`. [rfc]: fillmein The major focus of this redesign is to cut back on the level of abstraction to the point that each of the networking types is just a bare socket. To this end functionality such as timeouts and cloning has been removed (although cloning can be done through `duplicate`, it may just yield an error). With this `net` module comes a new implementation of `SocketAddr` and `IpAddr`. This work is entirely based on #20785 and the only changes were to alter the in-memory representation to match the `libc`-expected variants and to move from public fields to accessors.
2015-02-11std: Add a `net` module for TCP/UDPAlex Crichton-0/+1
This commit is an implementation of [RFC 807][rfc] which adds a `std::net` module for basic neworking based on top of `std::io`. This module serves as a replacement for the `std::old_io::net` module and networking primitives in `old_io`. [rfc]: fillmein The major focus of this redesign is to cut back on the level of abstraction to the point that each of the networking types is just a bare socket. To this end functionality such as timeouts and cloning has been removed (although cloning can be done through `duplicate`, it may just yield an error). With this `net` module comes a new implementation of `SocketAddr` and `IpAddr`. This work is entirely based on #20785 and the only changes were to alter the in-memory representation to match the `libc`-expected variants and to move from public fields to accessors.
2015-02-11rollup merge of #22178: pnkfelix/featuregate-unsafe-no-drop-flagAlex Crichton-1/+3
Conflicts: src/libsyntax/feature_gate.rs
2015-02-11rustc: Fix a number of stability lint holesAlex Crichton-2/+3
There are a number of holes that the stability lint did not previously cover, including: * Types * Bounds on type parameters on functions and impls * Where clauses * Imports * Patterns (structs and enums) These holes have all been fixed by overriding the `visit_path` function on the AST visitor instead of a few specialized cases. This change also necessitated a few stability changes: * The `collections::fmt` module is now stable (it was already supposed to be). * The `thread_local::imp::Key` type is now stable (it was already supposed to be). * The `std::rt::{begin_unwind, begin_unwind_fmt}` functions are now stable. These are required via the `panic!` macro. * The `std::old_io::stdio::{println, println_args}` functions are now stable. These are required by the `print!` and `println!` macros. * The `ops::{FnOnce, FnMut, Fn}` traits are now `#[stable]`. This is required to make bounds with these traits stable. Note that manual implementations of these traits are still gated by default, this stability only allows bounds such as `F: FnOnce()`. Additionally, the compiler now has special logic to ignore its own generated `__test` module for the `--test` harness in terms of stability. Closes #8962 Closes #16360 Closes #20327 [breaking-change]
2015-02-11Feature-gate the `#[unsafe_no_drop_flag]` attribute.Felix S. Klock II-1/+3
See RFC 320, "Non-zeroing dynamic drops." Fix #22173 [breaking-change]
2015-02-10Auto merge of #21936 - alexcrichton:fsv2, r=aturonbors-0/+1
This commit is an implementation of [RFC 739][rfc] which adds a new `std::fs` module to the standard library. This module provides much of the same functionality as `std::old_io::fs` but it has many tweaked APIs as well as uses the new `std::path` module. [rfc]: https://github.com/rust-lang/rfcs/pull/739
2015-02-09std: Add a new `fs` moduleAlex Crichton-0/+1
This commit is an implementation of [RFC 739][rfc] which adds a new `std::fs` module to the standard library. This module provides much of the same functionality as `std::old_io::fs` but it has many tweaked APIs as well as uses the new `std::path` module. [rfc]: https://github.com/rust-lang/rfcs/pull/739
2015-02-07Make std::fmt a simple re-export from collectionsKeegan McAllister-1/+1
2015-02-07Feature-gate #![no_std]Keegan McAllister-0/+1
Fixes #21833. [breaking-change]
2015-02-07Don't use std:: paths in syntax extensions when compiling a #![no_std] crateKeegan McAllister-6/+8
Fixes #16803. Fixes #14342. Fixes half of #21827 -- slice syntax is still broken.
2015-02-04Auto merge of #21892 - huonw:deprecate-rand, r=alexcrichtonbors-1/+1
Use [`rand`](https://crates.io/crates/rand) and [`derive_rand`](https://crates.io/crates/derive_rand) from crates.io. [breaking-change]
2015-02-03rollup merge of #21835: alexcrichton/iov2Alex Crichton-3/+3
This commit is an implementation of [RFC 576][rfc] which adds back the `std::io` module to the standard library. No functionality in `std::old_io` has been deprecated just yet, and the new `std::io` module is behind the same `io` feature gate. [rfc]: https://github.com/rust-lang/rfcs/pull/576 A good bit of functionality was copied over from `std::old_io`, but many tweaks were required for the new method signatures. Behavior such as precisely when buffered objects call to the underlying object may have been tweaked slightly in the transition. All implementations were audited to use composition wherever possible. For example the custom `pos` and `cap` cursors in `BufReader` were removed in favor of just using `Cursor<Vec<u8>>`. A few liberties were taken during this implementation which were not explicitly spelled out in the RFC: * The old `LineBufferedWriter` is now named `LineWriter` * The internal representation of `Error` now favors OS error codes (a 0-allocation path) and contains a `Box` for extra semantic data. * The io prelude currently reexports `Seek` as `NewSeek` to prevent conflicts with the real prelude reexport of `old_io::Seek` * The `chars` method was moved from `BufReadExt` to `ReadExt`. * The `chars` iterator returns a custom error with a variant that explains that the data was not valid UTF-8.
2015-02-04Deprecate in-tree `rand`, `std::rand` and `#[derive(Rand)]`.Huon Wilson-1/+1
Use the crates.io crate `rand` (version 0.1 should be a drop in replacement for `std::rand`) and `rand_macros` (`#[derive_Rand]` should be a drop-in replacement). [breaking-change]
2015-02-03Rename std::path to std::old_pathAaron Turon-0/+1
As part of [RFC 474](https://github.com/rust-lang/rfcs/pull/474), this commit renames `std::path` to `std::old_path`, leaving the existing path API in place to ease migration to the new one. Updating should be as simple as adjusting imports, and the prelude still maps to the old path APIs for now. [breaking-change]
2015-02-03std: Add `io` module againAlex Crichton-3/+3
This commit is an implementation of [RFC 576][rfc] which adds back the `std::io` module to the standard library. No functionality in `std::old_io` has been deprecated just yet, and the new `std::io` module is behind the same `io` feature gate. [rfc]: https://github.com/rust-lang/rfcs/pull/576 A good bit of functionality was copied over from `std::old_io`, but many tweaks were required for the new method signatures. Behavior such as precisely when buffered objects call to the underlying object may have been tweaked slightly in the transition. All implementations were audited to use composition wherever possible. For example the custom `pos` and `cap` cursors in `BufReader` were removed in favor of just using `Cursor<Vec<u8>>`. A few liberties were taken during this implementation which were not explicitly spelled out in the RFC: * The old `LineBufferedWriter` is now named `LineWriter` * The internal representation of `Error` now favors OS error codes (a 0-allocation path) and contains a `Box` for extra semantic data. * The io prelude currently reexports `Seek` as `NewSeek` to prevent conflicts with the real prelude reexport of `old_io::Seek` * The `chars` method was moved from `BufReadExt` to `ReadExt`. * The `chars` iterator returns a custom error with a variant that explains that the data was not valid UTF-8.
2015-02-02rollup merge of #21830: japaric/for-cleanupAlex Crichton-2/+1
Conflicts: src/librustc/metadata/filesearch.rs src/librustc_back/target/mod.rs src/libstd/os.rs src/libstd/sys/windows/os.rs src/libsyntax/ext/tt/macro_parser.rs src/libsyntax/print/pprust.rs src/test/compile-fail/issue-2149.rs