summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2016-03-23Rollup merge of #32429 - alexcrichton:scope-id-hton, r=aturonEduard-Mihai Burtescu-6/+6
std: Store flowinfo/scope_id in host byte order Apparently these aren't supposed to be stored in network byte order, so doing so ends up causing failures when it would otherwise succeed when stored in the host byte order. Closes #32424
2016-03-23Rollup merge of #32404 - WiSaGaN:feature/osstring-implement-default, r=aturonEduard-Mihai Burtescu-0/+28
Implement Default trait for OsString/OsStr Fixes #32385
2016-03-23Auto merge of #32390 - japaric:untry, r=pnkfelixbors-356/+357
convert 99.9% of `try!`s to `?`s The first commit is an automated conversion using the [untry] tool and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [untry]: https://github.com/japaric/untry cc @rust-lang/lang @alexcrichton @brson
2016-03-23Add code examples for libstd/timeGuillaume Gomez-0/+50
2016-03-22Add augmented assignment operator impls for time typesSteven Fackler-2/+58
2016-03-22Auto merge of #32058 - pczarn:hashmap-initial-refactoring, r=apasel422bors-224/+250
Basic refactoring of HashMap
2016-03-22fix alignmentJorge Aparicio-21/+21
2016-03-22std: undo conversion of user defined try!sJorge Aparicio-11/+11
2016-03-22sprinkle feature gates here and thereJorge Aparicio-0/+1
2016-03-22try! -> ?Jorge Aparicio-347/+347
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-03-22std: Change `encode_utf{8,16}` to return iteratorsAlex Crichton-19/+12
Currently these have non-traditional APIs which take a buffer and report how much was filled in, but they're not necessarily ergonomic to use. Returning an iterator which *also* exposes an underlying slice shouldn't result in any performance loss as it's just a lazy version of the same implementation, and it's also much more ergonomic! cc #27784
2016-03-22std: Store flowinfo/scope_id in host byte orderAlex Crichton-6/+6
Apparently these aren't supposed to be stored in network byte order, so doing so ends up causing failures when it would otherwise succeed when stored in the host byte order. Closes #32424
2016-03-22Fixes test which are now run due to should_panicLukas Pustina-1/+5
Since I changed no_run to should_panic on some tests, the were run but two lacked an actual assertion. Further, I missed to check the return type on another test.
2016-03-22f clarification, docsPiotr Czarnecki-2/+10
2016-03-22f Put and DerefMutPiotr Czarnecki-14/+26
2016-03-22doc: small char improvementsTshepang Lekhonkhobe-3/+3
2016-03-22Fix Default for OsString/OsStrWangshan Lu-3/+3
2016-03-21f dead codePiotr Czarnecki-10/+0
2016-03-21std: Link to gcc_s on NetBSDAlex Crichton-1/+3
Currently the nightlies we're producing fail when linking some C code into a Rust application with the error message: libgcc_s.so.1: error adding symbols: DSO missing from command line By linking `gcc_s` instead of `gcc` this error goes away. I haven't tested this on NetBSD itself, but should help get the Linux cross-compile image moreso up and working!
2016-03-22Implement Default for OsStrWangshan Lu-0/+14
2016-03-22Implement Default for OsStringWangshan Lu-0/+14
2016-03-21Adjusts all rust doc test to use `expect` and `should_panic`Lukas Pustina-14/+13
- All Rust Doc tests execute the same command `/bin/cat file.txt` which `should_panic` on all platforms consistently, because either `/bin/cat` or `file.txt` do not exist.
2016-03-20std: Add regression test for #32074Alex Crichton-0/+6
Just to make sure we don't accidentally break this in the future.
2016-03-20Add unix socket support to the standard librarySteven Fackler-55/+1141
2016-03-19Fixes 2. stdout to stderr in rustdocLukas Pustina-1/+1
2016-03-19Auto merge of #32314 - alexcrichton:ascii-fun, r=aturonbors-102/+0
std: Revert addition of `into_ascii_*` methods The addition of these methods in #31335 required adding impls of the trait for the `String` and `Vec<T>` types. This unfortunately caused a regression (#32074) in type inference for using these methods which the libs team has decided to not push forward with. These methods were stabilized in #32020 which was intended to get backported to beta, but the backport hasn't happened just yet. This commit reverts both the addition and stabilization of these methods. One proposed method of handling this, in #32076, was to move the methods to an extra trait to avoid conflicts with type inference. After some discussion, however, the libs team concluded that we probably want to reevaluate what we're doing here, so discussion will continue on the tracking issue, #27809. Closes #32074
2016-03-19Rollup merge of #32329 - sfackler:assert-recover-safe-pub, r=aturonEduard-Mihai Burtescu-3/+7
Make AssertRecoverSafe's field public It's basically the very definition of a newtype, so we might as well make things easy on people and let them construct and access it directly. r? @aturon
2016-03-19Revert "Tags new test as `no_run` and uses expect()"Lukas Pustina-3/+4
- After discussing with @alexcrichton, the initial commit has been fine. This reverts commit 3b5cfa3ecf4e44b251ce121ab5dcf53c35de8eea.
2016-03-18Auto merge of #32050 - achanda:from-slice-v4, r=alexcrichtonbors-0/+12
Add an impl for From trait Converts a u8 slice to a Ipv4Addr More discussion on this here: https://github.com/rust-lang/rfcs/pull/1498#issuecomment-191921655
2016-03-19Add functions to convert IPv6 addresses from and to octetsTobias Bucher-21/+43
See also #32313.
2016-03-18Tags new test as `no_run` and uses expect()Lukas Pustina-4/+3
2016-03-18Fix tidySteven Fackler-2/+4
2016-03-18Auto merge of #32282 - sfackler:panic-hook, r=alexcrichtonbors-33/+45
Adjustments to the panic hook API Rename `set_handler` and `take_handler` to `set_hook` and `take_hook` since we're not actually "handling" (i.e. fixing) anything. Also alter `set_hook` to take a `Box<Fn(&PanicInfo) + 'static + Sync + Send>` rather than a parameterized closure since there's otherwise no easy way to re-register a hook that came from `take_hook`. cc #30449 r? @aturon
2016-03-18Add a since to deprecationsSteven Fackler-2/+2
2016-03-18Extends rustdoc on how to caputure outputLukas Pustina-0/+23
2016-03-18Auto merge of #32080 - eddyb:transcendent, r=nikomatsakisbors-0/+3
Refactor call & function handling in trans, enable MIR bootstrap. Non-Rust and Rust ABIs were combined into a common codepath, which means: * The ugly `__rust_abi` "clown shoes" shim for C->Rust FFI is gone, fixes #10116. * Methods, *including virtual ones* support non-Rust ABIs, closes #30235. * Non-Rust ABIs also pass fat pointers in two arguments; the result should be identical. * Zero-sized types are never passed as arguments; again, behavior shouldn't change. Additionally, MIR support for calling intrinsics (through old trans) was implemented. Alongside assorted fixes, it enabled MIR to launch :rocket: and do a *complete* bootstrap. To try it yourself, `./configure --enable-orbit` *or* `make RUSTFLAGS="-Z orbit"`.
2016-03-18Auto merge of #32248 - dstu:master, r=alexcrichtonbors-0/+49
Expose the key of Entry variants for HashMap and BTreeMap. This PR addresses [issue 1541](https://github.com/rust-lang/rfcs/issues/1541) by exposing the key of `HashMap` and `BTreeMap` entry variants. Basic tests are provided.
2016-03-17Auto merge of #32207 - achanda:ipv6-doc, r=alexcrichtonbors-19/+29
Add is_documentation for IPv6 This function returns true if the given IPv6 is reserved for documentation. Also, reject this block in the is_global check
2016-03-17Make AssertRecoverSafe's field publicSteven Fackler-3/+5
It's basically the very definition of a newtype, so we might as well make things easy on people and let them construct and access it directly.
2016-03-17fixup Cleaner Recover::replacePiotr Czarnecki-11/+15
2016-03-17Add #[rustc_no_mir] to make tests pass with -Z orbit.Eduard Burtescu-0/+3
2016-03-17std: Revert addition of `into_ascii_*` methodsAlex Crichton-102/+0
The addition of these methods in #31335 required adding impls of the trait for the `String` and `Vec<T>` types. This unfortunately caused a regression (#32074) in type inference for using these methods which the libs team has decided to not push forward with. These methods were stabilized in #32020 which was intended to get backported to beta, but the backport hasn't happened just yet. This commit reverts both the addition and stabilization of these methods. One proposed method of handling this, in #32076, was to move the methods to an extra trait to avoid conflicts with type inference. After some discussion, however, the libs team concluded that we probably want to reevaluate what we're doing here, so discussion will continue on the tracking issue, #27809.
2016-03-15Make set_hook take a Box<Fn>Steven Fackler-3/+2
Otherwise there's no good way of re-registering a hook you got out of take_hook.
2016-03-15Rename panic handlers to panic hookSteven Fackler-33/+46
2016-03-15Use issue number from rust-lang/rust, not rust-lang/rfcs.Stu Black-2/+2
2016-03-15std: Fix overflow when subtracting InstantAlex Crichton-4/+4
This code was currently only exercised on OSX, but this applies the same method of subtraction used on Linux which doesn't have the same overflow issues. Note that this currently includes no tests, but that's because this is only visible with debug assertions enabled. Soon, however, I'll enable debug assertions on all auto builds on the bots so we should get testing for this. Closes #32268
2016-03-14std: Fix inheriting stdin on status()Alex Crichton-1/+1
This regression was accidentally introduced in #31618, and it's just flipping a boolean! Closes #32254
2016-03-14Expose the key of Entry variants for HashMap and BTreeMap.Stu Black-0/+49
2016-03-13Add is_documentation for IPv6Abhishek Chanda-19/+29
This function returns true if the given IPv6 is reserved for documentation. Also, reject this block in the is_global check
2016-03-13Auto merge of #32211 - achanda:ipv6-global, r=alexcrichtonbors-1/+3
Reject unspecified IP from global Also fixed the test