summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-06-27Update to 0.11.0 0.11.0Alex Crichton-2/+2
2014-06-27auto merge of #15206 : omasanori/rust/use-reexported, r=alexcrichtonbors-10/+10
We use re-exported pathes (e.g. std::io::Command) and original ones (e.g. std::io::process::Command) together in examples now. Using re-exported ones consistently avoids confusion.
2014-06-27std::io: Use re-exported pathes in examples.OGINO Masanori-10/+10
We use re-exported pathes (e.g. std::io::Command) and original ones (e.g. std::io::process::Command) together in examples now. Using re-exported ones consistently avoids confusion. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-06-26auto merge of #14886 : alexcrichton/rust/rt-improvements, r=brsonbors-2/+13
Most of the comments are available on the Task structure itself, but this commit is aimed at making FFI-style usage of Rust tasks a little nicer. Primarily, this commit enables re-use of tasks across multiple invocations. The method `run` will no longer unconditionally destroy the task itself. Rather, the task will be internally re-usable if the closure specified did not fail. Once a task has failed once it is considered poisoned and it can never be used again. Along the way I tried to document shortcomings of the current method of tearing down a task, opening a few issues as well. For now none of the behavior is a showstopper, but it's useful to acknowledge it. Also along the way I attempted to remove as much `unsafe` code as possible, opting for safer abstractions.
2014-06-26rustrt: Reorganize task usageAlex Crichton-2/+13
Most of the comments are available on the Task structure itself, but this commit is aimed at making FFI-style usage of Rust tasks a little nicer. Primarily, this commit enables re-use of tasks across multiple invocations. The method `run` will no longer unconditionally destroy the task itself. Rather, the task will be internally re-usable if the closure specified did not fail. Once a task has failed once it is considered poisoned and it can never be used again. Along the way I tried to document shortcomings of the current method of tearing down a task, opening a few issues as well. For now none of the behavior is a showstopper, but it's useful to acknowledge it. Also along the way I attempted to remove as much `unsafe` code as possible, opting for safer abstractions.
2014-06-26Remove unnecessary to_string callsPiotr Jawniak-1/+1
This commit removes superfluous to_string calls from various places
2014-06-25Fix wrong type name: IoError<()> -> IoResult<()>Alexei Sholik-1/+1
2014-06-25Fix a typo in fmt.rsAlexei Sholik-2/+2
2014-06-24Test fixes from the rollupAlex Crichton-0/+4
Closes #14482 (std: Bring back half of Add on String) Closes #15026 (librustc: Remove the fallback to `int` from typechecking.) Closes #15119 (Add more description to c_str::unwrap().) Closes #15120 (Add tests for #12470 and #14285) Closes #15122 (Remove the cheat sheet.) Closes #15126 (rustc: Always include the morestack library) Closes #15127 (Improve ambiguous pronoun.) Closes #15130 (Fix #15129) Closes #15131 (Add the Guide, add warning to tutorial.) Closes #15134 (Xfailed tests for hygiene, etc.) Closes #15135 (core: Add stability attributes to Clone) Closes #15136 (Some minor improvements to core::bool) Closes #15137 (std: Add stability attributes to primitive numeric modules) Closes #15141 (Fix grammar in tutorial) Closes #15143 (Remove few FIXMEs) Closes #15145 (Avoid unnecessary temporary on assignments) Closes #15147 (Small improvements for metaprogramming) Closes #15153 (librustc: Check function argument patterns for legality of by-move) Closes #15154 (test: Add a test for regions, traits, and variance.) Closes #15159 (rustc: Don't register syntax crates twice) Closes #13816 (Stabilize version output for rustc and rustdoc)
2014-06-24std: Add stability attributes to primitive numeric modulesBrian Anderson-0/+24
The following are unstable: - core::int, i8, i16, i32, i64 - core::uint, u8, u16, u32, u64 - core::int::{BITS, BYTES, MIN, MAX}, etc. - std::int, i8, i16, i32, i64 - std::uint, u8, u16, u32, u64 The following are experimental: - std::from_str::FromStr and impls - may need to return Result instead of Option - std::int::parse_bytes, etc. - ditto - std::num::FromStrRadix and impls - ditto - std::num::from_str_radix - ditto The following are deprecated: - std::num::ToStrRadix and imples - Wrapper around fmt::radix. Wrong name (Str vs String) See https://github.com/rust-lang/rust/wiki/Meeting-API-review-2014-06-23#uint
2014-06-24core: Add stability attributes to CloneBrian Anderson-0/+1
The following are tagged 'unstable' - core::clone - Clone - Clone::clone - impl Clone for Arc - impl Clone for arc::Weak - impl Clone for Rc - impl Clone for rc::Weak - impl Clone for Vec - impl Clone for Cell - impl Clone for RefCell - impl Clone for small tuples The following are tagged 'experimental' - Clone::clone_from - may not provide enough utility - impls for various extern "Rust" fns - may not handle lifetimes correctly See https://github.com/rust-lang/rust/wiki/Meeting-API-review-2014-06-23#clone
2014-06-24librustc: Remove the fallback to `int` from typechecking.Niko Matsakis-148/+148
This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change]
2014-06-24auto merge of #14963 : w3ln4/rust/master, r=alexcrichtonbors-0/+4
The aim of these changes is not working out a generic bi-endianness architectures support but to allow people develop for little endian MIPS machines (issue #7190).
2014-06-24Added Mipsel architecture supportPawel Olzacki-0/+4
2014-06-23librustc: Feature gate lang items and intrinsics.Patrick Walton-2/+3
If you define lang items in your crate, add `#[feature(lang_items)]`. If you define intrinsics (`extern "rust-intrinsic"`), add `#[feature(intrinsics)]`. Closes #12858. [breaking-change]
2014-06-22Register new snapshotsAlex Crichton-1/+0
2014-06-21std: inline many of the Writer/Reader methodsErick Tryzelaar-0/+127
This allows llvm to optimize away much of the overhead from using the MemReader/MemWriters. My benchmarks showed it to shave 15% off of my in progress serialization/json encoding.
2014-06-20librustc: Put `#[unsafe_destructor]` behind a feature gate.Patrick Walton-2/+4
Closes #8142. This is not the semantics we want long-term. You can continue to use `#[unsafe_destructor]`, but you'll need to add `#![feature(unsafe_destructor)]` to the crate attributes. [breaking-change]
2014-06-20auto merge of #15047 : brson/rust/taskdocs, r=huonwbors-9/+25
This corrects some misinformation.
2014-06-19std::sync::TaskPool: Improve module documentationAlexandre Gagnon-13/+17
The struct and module doc comments are reformulated. The `execute` method's documentation are put up to date, and failure information is added. A test is also added to address the possible failure.
2014-06-19std: Update std::task docs to reflect modern timesBrian Anderson-9/+25
This corrects some misinformation.
2014-06-18Revert bytes!() docstring change, and fix a typo.Simon Sapin-1/+1
2014-06-18Deprecate the bytes!() macro.Simon Sapin-239/+209
Replace its usage with byte string literals, except in `bytes!()` tests. Also add a new snapshot, to be able to use the new b"foo" syntax. The src/etc/2014-06-rewrite-bytes-macros.py script automatically rewrites `bytes!()` invocations into byte string literals. Pass it filenames as arguments to generate a diff that you can inspect, or `--apply` followed by filenames to apply the changes in place. Diffs can be piped into `tip` or `pygmentize -l diff` for coloring.
2014-06-18Revamp TaskBuilder APIAaron Turon-381/+460
This patch consolidates and cleans up the task spawning APIs: * Removes the problematic `future_result` method from `std::task::TaskBuilder`, and adds a `try_future` that both spawns the task and returns a future representing its eventual result (or failure). * Removes the public `opts` field from `TaskBuilder`, instead adding appropriate builder methods to configure the task. * Adds extension traits to libgreen and libnative that add methods to `TaskBuilder` for spawning the task as a green or native thread. Previously, there was no way to benefit from the `TaskBuilder` functionality and also set the scheduler to spawn within. With this change, all task spawning scenarios are supported through the `TaskBuilder` interface. Closes #3725. [breaking-change]
2014-06-18Merge the Bitwise and ByteOrder traits into the Int traitBrendan Zabarauskas-1/+1
This reduces the complexity of the trait hierarchy.
2014-06-18auto merge of #14984 : thestinger/rust/libc, r=alexcrichtonbors-6/+5
2014-06-18std: Remove dual export of `Show`Alex Crichton-1/+1
Closes #14996
2014-06-18fix signatures of mmap-related functions from libcDaniel Micay-6/+5
2014-06-16std: Chunk writing to stdout on windowsAlex Crichton-4/+15
This just takes a similar approach to reading stdin on windows by artificially limiting the size of the buffers going in and out. Closes #14940
2014-06-16std: Don't fail the task when a Future is droppedAlex Crichton-1/+27
It's a benign failure that no one needs to know about. Closes #14892
2014-06-16Move `num_cpus` from `std::rt::util` to `std::os`. Closes #14707Jorge Aparicio-13/+16
2014-06-16auto merge of #14781 : alexcrichton/rust/issue-14724, r=brsonbors-26/+76
* os::pipe() now returns `IoResult<os::Pipe>` * os::pipe() is now unsafe because it does not arrange for deallocation of file descriptors * PipeStream::pair() has been added. This is a safe method to get a pair of pipes. * Dealing with pipes in native process bindings have been improved to be more robust in the face of failure and intermittent errors. This converts a few fail!() situations to Err situations. cc #13538 Closes #14724 [breaking-change]
2014-06-16std: Improve pipe() functionalityAlex Crichton-26/+76
* os::pipe() now returns IoResult<os::Pipe> * os::pipe() is now unsafe because it does not arrange for deallocation of file descriptors * os::Pipe fields are renamed from input to reader and out to write. * PipeStream::pair() has been added. This is a safe method to get a pair of pipes. * Dealing with pipes in native process bindings have been improved to be more robust in the face of failure and intermittent errors. This converts a few fail!() situations to Err situations. Closes #9458 cc #13538 Closes #14724 [breaking-change]
2014-06-16std: Support consuming a Process without waitingAlex Crichton-0/+23
Forking off a child which survives the parent is often a useful task, and is currently not possible because the Process type will invoke `wait()` in its destructor in order to prevent leaking resources. This function adds a new safe method, `forget`, which can be used to consume an instance of `Process` which will then not call `wait` in the destructor. This new method is clearly documented as a leak of resources, but it must be forcibly opted in to. Closes #14467
2014-06-16auto merge of #14900 : alexcrichton/rust/snapshots, r=huonwbors-86/+36
Closes #14898 Closes #14918
2014-06-16auto merge of #14715 : vhbit/rust/ios-pr2, r=alexcrichtonbors-11/+211
2014-06-15Register new snapshotsAlex Crichton-86/+36
2014-06-14rustc: Obsolete the `@` syntax entirelyAlex Crichton-4/+0
This removes all remnants of `@` pointers from rustc. Additionally, this removes the `GC` structure from the prelude as it seems odd exporting an experimental type in the prelude by default. Closes #14193 [breaking-change]
2014-06-14Register new snapshotsAlex Crichton-8/+1
2014-06-13Rolling up PRs in the queueAlex Crichton-7/+12
Closes #14797 (librustc: Fix the issue with labels shadowing variable names by making) Closes #14823 (Improve error messages for io::fs) Closes #14827 (libsyntax: Allow `+` to separate trait bounds from objects.) Closes #14834 (configure: Don't sync unused submodules) Closes #14838 (Remove typo on collections::treemap::UnionItems) Closes #14839 (Fix the unused struct field lint for struct variants) Closes #14840 (Clarify `Any` docs) Closes #14846 (rustc: [T, ..N] and [T, ..N+1] are not the same) Closes #14847 (Audit usage of NativeMutex) Closes #14850 (remove unnecessary PaX detection) Closes #14856 (librustc: Take in account mutability when casting array to raw ptr.) Closes #14859 (librustc: Forbid `transmute` from being called on types whose size is) Closes #14860 (Fix `quote_pat!` & parse outer attributes in `quote_item!`)
2014-06-13librustc: Forbid `transmute` from being called on types whose size isPatrick Walton-1/+1
only known post-monomorphization, and report `transmute` errors before the code is generated for that `transmute`. This can break code that looked like: unsafe fn f<T>(x: T) { let y: int = transmute(x); } Change such code to take a type parameter that has the same size as the type being transmuted to. Closes #12898. [breaking-change]
2014-06-13std: Rebase better errors on masterAlex Crichton-7/+11
2014-06-13Improve error messages for io::fsYehuda Katz-64/+244
2014-06-13auto merge of #14831 : alexcrichton/rust/format-intl, r=brsonbors-82/+54
* The select/plural methods from format strings are removed * The # character no longer needs to be escaped * The \-based escapes have been removed * '{{' is now an escape for '{' * '}}' is now an escape for '}' Closes #14810 [breaking-change]
2014-06-13Cosmetic fixes & commentsValerii Hiora-3/+8
2014-06-13auto merge of #14816 : theptrk/rust/unclear-comment, r=huonwbors-1/+1
The old comment left it unclear if this is creating a random value or doing a check as to whether or not the generator is available or some other operation. See: http://stackoverflow.com/questions/24153311/when-is-rng-gen-not-true
2014-06-12Basic iOS supportValerii Hiora-11/+206
2014-06-11auto merge of #14713 : darnuria/rust/Improve_std_os_documentation_#2, ↵bors-76/+140
r=alexcrichton Improving documentation, consistency, removes evils empty lines etc...
2014-06-12Improve docs and refactore std::os.Axel Viala-76/+140
2014-06-11std: Remove i18n/l10n from format!Alex Crichton-82/+54
* The select/plural methods from format strings are removed * The # character no longer needs to be escaped * The \-based escapes have been removed * '{{' is now an escape for '{' * '}}' is now an escape for '}' Closes #14810 [breaking-change]