summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2015-02-15Rollup merge of #22297 - nagisa:spring-cleanup, r=alexcrichtonManish Goregaokar-8/+8
This PR replaces uses of `os::getenv` with newly introduced `env::var{,_os}`. Mostly did this as a background activity to procrastinate from procrastinating. Tests appear to build and run fine. This includes benchmarks from test/bench directory.
2015-02-15Rollup merge of #22339 - petrochenkov:int, r=huonwManish Goregaokar-23/+23
Some function signatures have changed, so this is a [breaking-change]. In particular, radixes and numerical values of digits are represented by `u32` now. Part of #22240
2015-02-15Rollup merge of #22351 - blaenk:path-hash, r=huonwManish Goregaokar-0/+1
`PathBuf` does implement `Hash`, but `Path` doesn't. This makes it annoying if you have a `HashMap` with `PathBuf`s as keys, because it means you have to convert a `Path` into a `PathBuf` and get a reference to it simply to perform operations on the `HashMap`!
2015-02-15Rollup merge of #22347 - iKevinY:std-lib-panicking, r=brsonManish Goregaokar-6/+6
Rename `libstd/failure.rs` to `libstd/panicking.rs` and `on_fail` to `on_panic`. Closes #22306.
2015-02-15Rollup merge of #22328 - shepmaster:os_str_typo, r=steveklabnikManish Goregaokar-1/+1
2015-02-15Rollup merge of #22268 - steveklabnik:improve_wait, r=nikomatsakisManish Goregaokar-4/+11
Remove incorrect claim, add example, reformat and re-word. Fixes #22266
2015-02-15Rollup merge of #22254 - huonw:float-value--, r=aturonManish Goregaokar-0/+2
In `std::f32` and `std::f64`: - `MIN_VALUE` → `MIN` - `MAX_VALUE` → `MAX` - `MIN_POS_VALUE` → `MIN_POSITIVE` This matches the corresponding integer constants. [breaking-change]
2015-02-15Auto merge of #22242 - Gankro:collect-ints, r=alexcrichtonbors-27/+27
2015-02-15openbsd: disable test_file_desc testSébastien Marie-1/+4
pipe(2), under FreeBSD and OpenBSD return a bidirectionnal pipe. So reading from the writer would block (waiting data) instead of returning an error.
2015-02-15doc: fix and expand File::create explanationTshepang Lekhonkhobe-3/+3
2015-02-15Fix the falloutVadim Petrochenkov-21/+21
2015-02-15Audit integer types in libunicode, libcore/(char, str) and libstd/asciiVadim Petrochenkov-2/+2
2015-02-14Correct typoJake Goulding-1/+1
2015-02-14we forgot to make `Path` implement `Hash`Jorge Israel Peña-0/+1
`PathBuf` does implement `Hash`, but `Path` doesn't. This makes it annoying if you have a `HashMap` with `PathBuf`s as keys, because it means you have to convert a `Path` into a `PathBuf` and get a reference to it simply to perform operations on the `HashMap`!
2015-02-13Add std::processAaron Turon-36/+2051
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-6/+6
Closes #22306.
2015-02-13add an associated `Item` type to `IntoIterator`Jorge Aparicio-0/+80
2015-02-14Rename `fmt::Writer` to `fmt::Write`Chris Wong-8/+8
This brings it in line with its namesake in `std::io`. [breaking-change]
2015-02-13Remove a few uses of deprecated getenvSimonas Kazlauskas-8/+8
2015-02-13more int and cloned cleanup in collectionsAlexis-27/+27
2015-02-13Improve documentation for `Select::new()`.Steve Klabnik-4/+11
Remove incorrect claim, add example, reformat and re-word. Fixes #22266
2015-02-13Remove `_VALUE` from the float extremes constants.Huon Wilson-0/+2
In `std::f32` and `std::f64`: - `MIN_VALUE` → `MIN` - `MAX_VALUE` → `MAX` - `MIN_POS_VALUE` → `MIN_POSITIVE` This matches the corresponding integer constants. [breaking-change]
2015-02-11fix windows specific errno type errors.Jormundir-3/+3
2015-02-11More test fixes and rebase conflictsAlex Crichton-1/+44
2015-02-11rollup merge of #22015: alexcrichton/netv2Alex Crichton-6/+3214
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-6/+3214
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-11Test fixes and rebase conflictsAlex Crichton-3/+7
2015-02-11fixing PR review commentsDave Huseby-9/+4
2015-02-11PR review fixesDave Huseby-12/+2
2015-02-11fixing more trailing whitespaceDave Huseby-1/+1
2015-02-11fixing trailing whitespace errorsDave Huseby-10/+10
2015-02-11bitrig integrationDave Huseby-18/+236
2015-02-11rollup merge of #22178: pnkfelix/featuregate-unsafe-no-drop-flagAlex Crichton-1/+3
Conflicts: src/libsyntax/feature_gate.rs
2015-02-11rollup merge of #22188: alexcrichton/envv2Alex Crichton-51/+136
This commit tweaks the interface of the `std::env` module to make it more ergonomic for common usage: * `env::var` was renamed to `env::var_os` * `env::var_string` was renamed to `env::var` * `env::args` was renamed to `env::args_os` * `env::args` was re-added as a panicking iterator over string values * `env::vars` was renamed to `env::vars_os` * `env::vars` was re-added as a panicking iterator over string values. This should make common usage (e.g. unicode values everywhere) more ergonomic as well as "the default". This is also a breaking change due to the differences of what's yielded from each of these functions, but migration should be fairly easy as the defaults operate over `String` which is a common type to use. [breaking-change]
2015-02-11rollup merge of #22186: GuillaumeGomez/fix-fsAlex Crichton-1/+3
Fixes issue #22174.
2015-02-11rollup merge of #22177: semarie/openbsd-notlsAlex Crichton-4/+22
OpenBSD doesn't have thread-local-storage support (yet). Permit to compile (and run) `check-stage1-crates` under OpenBSD.
2015-02-11rollup merge of #22162: ogham/patch-1Alex Crichton-1/+2
It returns `false`, not `None`.
2015-02-11rollup merge of #22127: alexcrichton/stability-holesAlex Crichton-46/+60
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()`. Closes #8962 Closes #16360 Closes #20327
2015-02-11std: Tweak the std::env OsString/String interfaceAlex Crichton-51/+136
This commit tweaks the interface of the `std::env` module to make it more ergonomic for common usage: * `env::var` was renamed to `env::var_os` * `env::var_string` was renamed to `env::var` * `env::args` was renamed to `env::args_os` * `env::args` was re-added as a panicking iterator over string values * `env::vars` was renamed to `env::vars_os` * `env::vars` was re-added as a panicking iterator over string values. This should make common usage (e.g. unicode values everywhere) more ergonomic as well as "the default". This is also a breaking change due to the differences of what's yielded from each of these functions, but migration should be fairly easy as the defaults operate over `String` which is a common type to use. [breaking-change]
2015-02-11rustc: Fix a number of stability lint holesAlex Crichton-46/+60
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-11Add read and write rights to group and other when creating fileGuillaumeGomez-1/+3
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-11openbsd don't support TLSSébastien Marie-4/+22
2015-02-11shift bindings to accommodate new lifetime/dtor rules.Felix S. Klock II-2/+4
(My fix to for-loops (21984) did not deal with similar problems in if-let expressions, so those binding shifts stay.)
2015-02-11Auto merge of #22076 - carols10cents:exp2-calling-exp, r=huonwbors-2/+56
I was working on adding examples to the documentation in `std::num::Float`. I got to `exp2`, which says "Returns 2 raised to the power of the number, `2^(self)`." So I tried running this code: ``` use std::num::Float; #[test] fn test_exp2() { assert_eq!(32.0, 5.0.exp2()); } ``` and it resulted in a failure of `(left: `32`, right: `148.413159`)`. That 148.413159 is the value for e^5, which is `exp()`, not `exp2()`. Sure enough, `exp2` is calling `exp` and shouldn't be, looks like a copy-paste error. I haven't added any tests for this since it's unlikely to break again, but I will happily do so if people think that would be a good idea. The doc examples are coming :) I scanned through the other functions in these files for similar sorts of errors and didn't notice any.
2015-02-11Documentation fix for PathBuf#popBen S-1/+2
It returns `false`, not `none`.
2015-02-10rollup merge of #22125: alexcrichton/into-iter-stabilityAlex Crichton-5/+5
* Remove type parameters from `IteratorExt::cloned` * Rename `IntoIterator::Iter` to `IntoIterator::IntoIter` * Mark `IntoIterator::into_iter` as stable (but not the trait, only the method).
2015-02-10rollup merge of #22094: alkor/cleanup-show-stringAlex Crichton-2/+2
Rename several remaining `Show`s to Debug, `String`s to Display (mostly in comments and docs). Update reference.md: - derive() no longer supports Zero trait - derive() now supports Copy trait
2015-02-10rollup merge of #22052: octplane/patch-1Alex Crichton-1/+1
- add namespace - add function parens
2015-02-10rollup merge of #21920: vojtechkral/main-thread-nameAlex Crichton-4/+5
Fixes #21911