about summary refs log tree commit diff
path: root/src/libstd/io
AgeCommit message (Collapse)AuthorLines
2014-12-28Added `get_address_name`, an interface to `getnameinfo`Murarth-2/+9
2014-12-27Fallout of changing format_args!(f, args) to f(format_args!(args)).Eduard Burtescu-0/+62
2014-12-27auto merge of #20119 : FlaPer87/rust/oibit-send-and-friends, r=nikomatsakisbors-15/+32
More work on opt-in built in traits. `Send` and `Sync` are not opt-in, `OwnedPtr` renamed to `UniquePtr` and the `Send` and `Sync` traits are now unsafe. NOTE: This likely needs to be rebased on top of the yet-to-land snapshot. r? @nikomatsakis cc #13231
2014-12-27Fix falloutNick Cameron-5/+5
2014-12-26Derive Clone, PartialEq, and Eq for std::io::{FileAccess, FileMode}Ivan Petkov-2/+2
* Both enums already derived `Copy`, but storing them in any struct/container would prevent implementing `Clone` for said struct/container even though they should be clonable. * Also add PartialEq and Eq for good measure.
2014-12-26Implement RaceBox for StdinReaderFlavio Percoco-15/+32
2014-12-25Map EEXIST to PathAlreadyExists error, closes #20226Florian Hahn-0/+13
2014-12-25Parse fully-qualified associated types in generics without whitespaceP1start-2/+2
This breaks code that looks like this: let x = foo as bar << 13; Change such code to look like this: let x = (foo as bar) << 13; Closes #17362. [breaking-change]
2014-12-23Fix some spelling errors.Huon Wilson-5/+5
2014-12-21Fallout of std::str stabilizationAlex Crichton-7/+8
2014-12-21rollup merge of #20077: shepmaster/stdin-typoAlex Crichton-1/+1
2014-12-21rollup merge of #20070: aturon/stab-2-cloneAlex Crichton-0/+1
This patch marks `clone` stable, as well as the `Clone` trait, but leaves `clone_from` unstable. The latter will be decided by the beta. The patch also marks most manual implementations of `Clone` as stable, except where the APIs are otherwise deprecated or where there is uncertainty about providing `Clone`. r? @alexcrichton
2014-12-21rollup merge of #19932: elszben/masterAlex Crichton-0/+50
First attempt to contribute to rust (and using github). This commit adds a few examples to std::io::TempDir. The examples seem to look okay (in my browser) and make check also passes.
2014-12-20Correct typo in doc for StdinReaderGuardJake Goulding-1/+1
2014-12-20Stabilize cloneAaron Turon-0/+1
This patch marks `clone` stable, as well as the `Clone` trait, but leaves `clone_from` unstable. The latter will be decided by the beta. The patch also marks most manual implementations of `Clone` as stable, except where the APIs are otherwise deprecated or where there is uncertainty about providing `Clone`.
2014-12-20Fix fallout of removing import_shadowing in tests.Eduard Burtescu-11/+5
2014-12-19libstd: use `#[deriving(Copy)]`Jorge Aparicio-49/+19
2014-12-18Delete rest of rustrtAaron Turon-0/+1
... and address other rebasing fallout.
2014-12-18Revise std::thread API to join by defaultAaron Turon-16/+16
This commit is part of a series that introduces a `std::thread` API to replace `std::task`. In the new API, `spawn` returns a `JoinGuard`, which by default will join the spawned thread when dropped. It can also be used to join explicitly at any time, returning the thread's result. Alternatively, the spawned thread can be explicitly detached (so no join takes place). As part of this change, Rust processes now terminate when the main thread exits, even if other detached threads are still running, moving Rust closer to standard threading models. This new behavior may break code that was relying on the previously implicit join-all. In addition to the above, the new thread API also offers some built-in support for building blocking abstractions in user space; see the module doc for details. Closes #18000 [breaking-change]
2014-12-18Fix the capture_stderr testAlex Crichton-4/+3
There's always a fun time having two sets of standard libraries when testing!
2014-12-18Disable capture_stderr test for nowAaron Turon-1/+1
2014-12-18Fallout from new thread APIAaron Turon-32/+28
2014-12-18libs: merge librustrt into libstdAaron Turon-4/+3
This commit merges the `rustrt` crate into `std`, undoing part of the facade. This merger continues the paring down of the runtime system. Code relying on the public API of `rustrt` will break; some of this API is now available through `std::rt`, but is likely to change and/or be removed very soon. [breaking-change]
2014-12-18librustc: Always parse `macro!()`/`macro![]` as expressions if notPatrick Walton-11/+13
followed by a semicolon. This allows code like `vec![1i, 2, 3].len();` to work. This breaks code that uses macros as statements without putting semicolons after them, such as: fn main() { ... assert!(a == b) assert!(c == d) println(...); } It also breaks code that uses macros as items without semicolons: local_data_key!(foo) fn main() { println("hello world") } Add semicolons to fix this code. Those two examples can be fixed as follows: fn main() { ... assert!(a == b); assert!(c == d); println(...); } local_data_key!(foo); fn main() { println("hello world") } RFC #378. Closes #18635. [breaking-change]
2014-12-17rollup merge of #19902: alexcrichton/second-pass-memAlex Crichton-0/+2
This commit stabilizes the `mem` and `default` modules of std.
2014-12-17rollup merge of #19873: drewm1980/masterAlex Crichton-5/+5
In US english, "that" is used in restrictive clauses in place of "which", and often affects the meaning of sentences. In UK english and many dialects, no distinction is made. While Rust devs want to avoid unproductive pedanticism, it is worth at least being uniform in documentation such as: http://doc.rust-lang.org/std/iter/index.html and also in cases where correct usage of US english clarifies the sentence.
2014-12-17rollup merge of #19869: sfackler/free-stdinAlex Crichton-0/+7
r? @aturon
2014-12-17rollup merge of #19859: alexcrichton/flaky-testAlex Crichton-1/+2
This test would read with a timeout and then send a UDP message, expecting the message to be received. The receiving port, however, was bound in the child thread so it could be the case that the timeout and send happens before the child thread runs. To remedy this we just bind the port before the child thread runs, moving it into the child later on. cc #19120
2014-12-17Replaced wrapper functions with no_run and as_str().unwrap() with display()elszben-6/+3
2014-12-16Added example to TempDirelszben-0/+53
2014-12-16auto merge of #19777 : nikomatsakis/rust/warn-on-shadowing, r=acrichtobors-5/+5
per rfc 459 cc https://github.com/rust-lang/rust/issues/19390 One question is: should we start by warning, and only switch to hard error later? I think we discussed something like this in the meeting. r? @alexcrichton
2014-12-15std: Second pass stabilization of `default`Alex Crichton-0/+2
This commit performs a second pass stabilization of the `std::default` module. The module was already marked `#[stable]`, and the inheritance of `#[stable]` was removed since this attribute was applied. This commit adds the `#[stable]` attribute to the trait definition and one method name, along with all implementations found in the standard distribution.
2014-12-16auto merge of #19747 : alexcrichton/rust/slice-one-trait, r=brsonbors-9/+9
This commit collapses the various prelude traits for slices into just one trait: * SlicePrelude/SliceAllocPrelude => SliceExt * CloneSlicePrelude/CloneSliceAllocPrelude => CloneSliceExt * OrdSlicePrelude/OrdSliceAllocPrelude => OrdSliceExt * PartialEqSlicePrelude => PartialEqSliceExt
2014-12-15Remove all shadowed lifetimes.Niko Matsakis-5/+5
2014-12-15rollup merge of #19710: steveklabnik/gh15449Brian Anderson-4/+4
Fixes #15499.
2014-12-15Standardize some usages of "which" in docstringsAndrew Wagner-5/+5
In US english, "that" is used in restrictive clauses in place of "which", and often affects the meaning of sentences. In UK english and many dialects, no distinction is made. While Rust devs want to avoid unproductive pedanticism, it is worth at least being uniform in documentation such as: http://doc.rust-lang.org/std/iter/index.html and also in cases where correct usage of US english clarifies the sentence.
2014-12-14Free stdin on exitSteven Fackler-0/+7
2014-12-14std: Collapse SlicePrelude traitsAlex Crichton-9/+9
This commit collapses the various prelude traits for slices into just one trait: * SlicePrelude/SliceAllocPrelude => SliceExt * CloneSlicePrelude/CloneSliceAllocPrelude => CloneSliceExt * OrdSlicePrelude/OrdSliceAllocPrelude => OrdSliceExt * PartialEqSlicePrelude => PartialEqSliceExt
2014-12-14std: Bind port early to make a test more reliableAlex Crichton-1/+2
This test would read with a timeout and then send a UDP message, expecting the message to be received. The receiving port, however, was bound in the child thread so it could be the case that the timeout and send happens before the child thread runs. To remedy this we just bind the port before the child thread runs, moving it into the child later on. cc #19120
2014-12-15auto merge of #19742 : vhbit/rust/copy-for-bitflags, r=alexcrichtonbors-1/+0
2014-12-14Mostly rote conversion of `proc()` to `move||` (and occasionally `Thunk::new`)Niko Matsakis-114/+117
2014-12-13libstd: use unboxed closuresJorge Aparicio-37/+62
2014-12-13Add `Copy` to bitflags-generated structuresValerii Hiora-1/+0
2014-12-11Register new snapshotsAlex Crichton-1/+1
2014-12-10Fix inappropriate ## headingsSteve Klabnik-4/+4
Fixes #15499.
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-0/+43
This change makes the compiler no longer infer whether types (structures and enumerations) implement the `Copy` trait (and thus are implicitly copyable). Rather, you must implement `Copy` yourself via `impl Copy for MyType {}`. A new warning has been added, `missing_copy_implementations`, to warn you if a non-generic public type has been added that could have implemented `Copy` but didn't. For convenience, you may *temporarily* opt out of this behavior by using `#![feature(opt_out_copy)]`. Note though that this feature gate will never be accepted and will be removed by the time that 1.0 is released, so you should transition your code away from using it. This breaks code like: #[deriving(Show)] struct Point2D { x: int, y: int, } fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } Change this code to: #[deriving(Show)] struct Point2D { x: int, y: int, } impl Copy for Point2D {} fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } This is the backwards-incompatible part of #13231. Part of RFC #3. [breaking-change]
2014-12-08auto merge of #19378 : japaric/rust/no-as-slice, r=alexcrichtonbors-59/+56
Now that we have an overloaded comparison (`==`) operator, and that `Vec`/`String` deref to `[T]`/`str` on method calls, many `as_slice()`/`as_mut_slice()`/`to_string()` calls have become redundant. This patch removes them. These were the most common patterns: - `assert_eq(test_output.as_slice(), "ground truth")` -> `assert_eq(test_output, "ground truth")` - `assert_eq(test_output, "ground truth".to_string())` -> `assert_eq(test_output, "ground truth")` - `vec.as_mut_slice().sort()` -> `vec.sort()` - `vec.as_slice().slice(from, to)` -> `vec.slice(from_to)` --- Note that e.g. `a_string.push_str(b_string.as_slice())` has been left untouched in this PR, since we first need to settle down whether we want to favor the `&*b_string` or the `b_string[]` notation. This is rebased on top of #19167 cc @alexcrichton @aturon
2014-12-07Fix syntax error on android testsJorge Aparicio-2/+2
2014-12-06libstd: remove unnecessary `to_string()` callsJorge Aparicio-19/+19
2014-12-06libstd: remove unnecessary `as_slice()` callsJorge Aparicio-40/+37