summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-11-13Create UnsignedInt trait and deprecate free functionsBrendan Zabarauskas-15/+14
2014-11-13Move abs_sub to FloatMathBrendan Zabarauskas-1/+23
This removes the need for libcore to depend on libm. `abs_sub` is not as useful for integers.
2014-11-13Take parameters by-value in Signed traitBrendan Zabarauskas-20/+20
2014-11-12auto merge of #18854 : thestinger/rust/spawn, r=aturonbors-1/+2
cc https://github.com/rust-lang/rust/issues/18000
2014-11-11std: Rename AsRef{Reader,Writer} to ByRef{Reader,Writer}Erick Tryzelaar-3/+38
2014-11-12Fix documentation bugBarosl Lee-0/+1
The first paragraph must be separated from the next paragraph. Otherwise, rustdoc will consider the content of the latter as part of the title.
2014-11-12Fix remaining documentation to reflect fail!() -> panic!()Barosl Lee-39/+39
Throughout the docs, "failure" was replaced with "panics" if it means a task panic. Otherwise, it remained as is, or changed to "errors" to clearly differentiate it from a task panic.
2014-11-10Add optional messages to the unreachable macro.Michael Sproul-1/+9
Closes #18842.
2014-11-10note the intent of reforming task spawningDaniel Micay-1/+2
2014-11-10Fix 'renamed lint' warningsMichael Gehring-3/+3
2014-11-10Fix broken documentation linkAdam Szkoda-1/+1
2014-11-08Runtime removal: fully remove rtioAaron Turon-13/+7
This patch cleans up the remnants of the runtime IO interface. Because this eliminates APIs in `libnative` and `librustrt`, it is a: [breaking-change] This functionality is likely to be available publicly, in some form, from `std` in the future.
2014-11-08Runtime removal: refactor ttyAaron Turon-33/+235
This patch continues runtime removal by moving the tty implementations into `sys`. Because this eliminates APIs in `libnative` and `librustrt`, it is a: [breaking-change] This functionality is likely to be available publicly, in some form, from `std` in the future.
2014-11-08Runtime removal: refactor timerAaron Turon-11/+500
This patch continues runtime removal by moving out timer-related code into `sys`. Because this eliminates APIs in `libnative` and `librustrt`, it is a: [breaking-change] This functionality is likely to be available publicly, in some form, from `std` in the future.
2014-11-08Runtime removal: refactor processAaron Turon-90/+1250
This patch continues the runtime removal by moving and refactoring the process implementation into the new `sys` module. Because this eliminates APIs in `libnative` and `librustrt`, it is a: [breaking-change] This functionality is likely to be available publicly, in some form, from `std` in the future.
2014-11-08Runtime removal: refactor helper threadsAaron Turon-0/+224
This patch continues the runtime removal by moving libnative::io::helper_thread into sys::helper_signal and sys_common::helper_thread Because this eliminates APIs in `libnative` and `librustrt`, it is a: [breaking-change] This functionality is likely to be available publicly, in some form, from `std` in the future.
2014-11-08Runtime removal: refactor pipes and networkingAaron Turon-283/+2569
This patch continues the runtime removal by moving pipe and networking-related code into `sys`. Because this eliminates APIs in `libnative` and `librustrt`, it is a: [breaking-change] This functionality is likely to be available publicly, in some form, from `std` in the future.
2014-11-08Runtime removal: refactor fsAaron Turon-224/+966
This moves the filesystem implementation from libnative into the new `sys` modules, refactoring along the way and hooking into `std::io::fs`. Because this eliminates APIs in `libnative` and `librustrt`, it is a: [breaking-change] This functionality is likely to be available publicly, in some form, from `std` in the future.
2014-11-08Runtime removal: add private sys, sys_common modulesAaron Turon-238/+1093
These modules will house the code that used to be part of the runtime system in libnative. The `sys_common` module contains a few low-level but cross-platform details. The `sys` module is set up using `#[cfg()]` to include either a unix or windows implementation of a common API surface. This API surface is *not* exported directly in `libstd`, but is instead used to bulid `std::os` and `std::io`. Ultimately, the low-level details in `sys` will be exposed in a controlled way through a separate platform-specific surface, but that setup is not part of this patch.
2014-11-08Implements Extend for EnumSet and LruCachegamazeps-1/+10
Part of #18424
2014-11-08Renamed Extendable to Extendgamazeps-8/+8
In order to upgrade, simply rename the Extendable trait to Extend in your code Part of #18424 [breaking-change]
2014-11-07auto merge of #18714 : nikomatsakis/rust/issue-18621-deref-for-refs, r=aturonbors-0/+4
libs: add Deref, DerefMut impls for references, fixing a bug in compiler in the process that was blocking this. r? @aturon
2014-11-06libs: add Deref, DerefMut impls for references, fixing a bug in compiler in ↵Niko Matsakis-0/+4
the process that was blocking this. Fixes #18621.
2014-11-07auto merge of #18713 : juxiliary/rust/master, r=alexcrichtonbors-1/+17
* `from_str_radix_float` gives incorrect results for negative float strings. Changes the accumulator used to start at -0.0 instead of -1.0. * Adds missing tests
2014-11-06Test fixes and rebase conflictsAlex Crichton-1/+1
2014-11-06rollup merge of #18691 : subhashb/add_clone_trait_to_filetypeAlex Crichton-1/+1
2014-11-06rollup merge of #18665 : scribu/patch-1Alex Crichton-1/+1
2014-11-06rollup merge of #18664 : klutzy/getrandomAlex Crichton-12/+120
2014-11-06rollup merge of #18628 : aturon/fixup-error-commentAlex Crichton-3/+0
2014-11-06rollup merge of #18605 : Gankro/collect-fruitAlex Crichton-220/+231
2014-11-07Fixing #18659juxiliary-1/+17
Changes the radix multiplier to start at -0.0 instead of -1.0 when reading strings that start with '-'.
2014-11-06Fallout from collection conventionsAlexis Beingessner-3/+3
2014-11-06Implement low-hanging fruit of collection conventionsAlexis Beingessner-217/+228
* Renames/deprecates the simplest and most obvious methods * Adds FIXME(conventions)s for outstanding work * Marks "handled" methods as unstable NOTE: the semantics of reserve and reserve_exact have changed! Other methods have had their semantics changed as well, but in a way that should obviously not typecheck if used incorrectly. Lots of work and breakage to come, but this handles most of the core APIs and most eggregious breakage. Future changes should *mostly* focus on niche collections, APIs, or simply back-compat additions. [breaking-change]
2014-11-06Prelude: rename and consolidate extension traitsAaron Turon-54/+51
This commit renames a number of extension traits for slices and string slices, now that they have been refactored for DST. In many cases, multiple extension traits could now be consolidated. Further consolidation will be possible with generalized where clauses. The renamings are consistent with the [new `-Prelude` suffix](https://github.com/rust-lang/rfcs/pull/344). There are probably a few more candidates for being renamed this way, but that is left for API stabilization of the relevant modules. Because this renames traits, it is a: [breaking-change] However, I do not expect any code that currently uses the standard library to actually break. Closes #17917
2014-11-06Make Filetype ClonableSubhash Bhushan-1/+1
2014-11-06std::rand::OsRng: Use `getrandom` syscall on Linuxklutzy-12/+120
`getrandom(2)` system call [1] has been added on Linux 3.17. This patch makes `OsRng` use `getrandom` if available, and use traditional `/dev/urandom` fallback if not. [1]: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c6e9d6f38894798696f23c8084ca7edbf16ee895
2014-11-05auto merge of #18486 : nikomatsakis/rust/operator-dispatch, r=pcwaltonbors-4/+4
This branch cleans up overloaded operator resolution so that it is strictly based on the traits in `ops`, rather than going through the normal method lookup mechanism. It also adds full support for autoderef to overloaded index (whereas before autoderef only worked for non-overloaded index) as well as for the slicing operators. This is a [breaking-change]: in the past, we were accepting combinations of operands that were not intended to be accepted. For example, it was possible to compare a fixed-length array and a slice, or apply the `!` operator to a `&int`. See the first two commits in this pull-request for examples. One downside of this change is that comparing fixed-length arrays doesn't always work as smoothly as it did before. Before this, comparisons sometimes worked due to various coercions to slices. I've added impls for `Eq`, `Ord`, etc for fixed-lengths arrays up to and including length 32, but if the array is longer than that you'll need to either newtype the array or convert to slices. Note that this plays better with deriving in any case than the previous scheme. Fixes #4920. Fixes #16821. Fixes #15757. cc @alexcrichton cc @aturon
2014-11-05Fix example in HashMap::new() docsCristi Burcă-1/+1
2014-11-05auto merge of #18462 : netvl/rust/to-socket-addr, r=alexcrichtonbors-250/+404
This is a follow-up to [RFC PR #173](https://github.com/rust-lang/rfcs/pull/173). I was told there that changes like this don't need to go through the RFC process, so I'm submitting this directly. This PR introduces `ToSocketAddr` trait as defined in said RFC. This trait defines a conversion from different types like `&str`, `(&str, u16)` or even `SocketAddr` to `SocketAddr`. Then this trait is used in all constructor methods for `TcpStream`, `TcpListener` and `UdpSocket`. This unifies these constructor methods - previously they were using different types of input parameters (TCP ones used `(&str, u16)` pair while UDP ones used `SocketAddr`), which is not consistent by itself and sometimes inconvenient - for example, when the address initially is available as `SocketAddr`, you still need to convert it to string to pass it to e.g. `TcpStream`. This is very prominently demonstrated by the unit tests for TCP functionality. This PR makes working with network objects much like with `Path`, which also uses similar trait to be able to be constructed from `&[u8]`, `Vec<u8>` and other `Path`s. This is a breaking change. If constant literals were used before, like this: ```rust TcpStream::connect("localhost", 12345) ``` then the nicest fix is to change it to this: ```rust TcpStream::connect("localhost:12345") ``` If variables were used before, like this: ```rust TcpStream::connect(some_address, some_port) ``` then the arguments should be wrapped in another set of parentheses: ```rust TcpStream::connect((some_address, some_port)) ``` `UdpSocket` usages won't break because its constructor method accepted `SocketAddr` which implements `ToSocketAddr`, so `bind()` calls: ```rust UdpSocket::bind(some_socket_addr) ``` will continue working as before. I haven't changed `UdpStream` constructor because it is deprecated anyway.
2014-11-05Fixed not compiling code in docstringVladimir Matveev-2/+2
2014-11-05Add impls of the comparison operators for fixed-length arrays of lengths ↵Niko Matsakis-1/+1
0...32 and repair various cases where slices and fixed-length arrays were being compared.
2014-11-05Repair various cases where values of distinct types were being operatedNiko Matsakis-3/+3
upon (e.g., `&int` added to `int`).
2014-11-05Register snapshots.Eduard Burtescu-16/+0
2014-11-05Added more documentation on ToSocketAddr traitVladimir Matveev-3/+92
2014-11-05Fixed tidy errorsVladimir Matveev-3/+3
2014-11-05Fixed other tests to pass make checkVladimir Matveev-8/+5
2014-11-05Migrated io::net::udp over to ToSocketAddrVladimir Matveev-20/+34
UdpSocket constructor methods now use ToSocketAddr trait instead of SocketAddr. [breaking-change]
2014-11-05Switched io::net::tcp to use ToSocketAddrVladimir Matveev-227/+130
TcpListener and TcpStream are converted to use ToSocketAddr trait in their constructor methods. [breaking-change]
2014-11-05Added ToSocketAddr traitVladimir Matveev-0/+151
This commit adds ToSocketAddr trait to std::io::net::ip module. This trait is used for generic conversion from different types (strings, (string, u16) tuples, etc.) into a SocketAddr instance. It supports multiple output SocketAddresses when it is appropriate (e.g. DNS name resolution). This trait is going to be used by TcpStream, TcpListener and UdpSocket structures.
2014-11-04libsyntax: Forbid escapes in the inclusive range `\x80`-`\xff` inPatrick Walton-0/+32
Unicode characters and strings. Use `\u0080`-`\u00ff` instead. ASCII/byte literals are unaffected. This PR introduces a new function, `escape_default`, into the ASCII module. This was necessary for the pretty printer to continue to function. RFC #326. Closes #18062. [breaking-change]