about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2015-03-01Auto merge of #22087 - GuillaumeGomez:int-pow, r=alexcrichtonbors-1/+1
Fixes issue #22016
2015-03-01remove some compiler warningsTshepang Lekhonkhobe-8/+6
2015-02-28std: Implement stdio for `std::io`Alex Crichton-6/+617
This is an implementation of RFC 899 and adds stdio functionality to the new `std::io` module. Details of the API can be found on the RFC, but from a high level: * `io::{stdin, stdout, stderr}` constructors are now available. There are also `*_raw` variants for unbuffered and unlocked access. * All handles are globally shared (excluding raw variants). * The stderr handle is no longer buffered. * All handles can be explicitly locked (excluding the raw variants). The `print!` and `println!` machinery has not yet been hooked up to these streams just yet. The `std::fmt::output` module has also not yet been implemented as part of this commit.
2015-03-01Fix errors, remove unused filesGuillaumeGomez-1/+1
2015-03-01Make Int::pow() take exp as u32 instead usizeGuillaume Gomez-1/+1
2015-02-28openbsd: adjust page guard addressSébastien Marie-1/+1
some commits in OpenBSD base have corrected a problem of stack position. Now, we can adjust more accurately the page guard in rust.
2015-02-28Rollup merge of #22884 - japaric:obsolete, r=alexcrichtonManish Goregaokar-2/+2
This is leftover from #21843 If you still have `|&:| {}` closures in your code, simply remove the `&:` part. [breaking-change]
2015-02-28Rollup merge of #22869 - alexcrichton:stabilize-env, r=aturonManish Goregaokar-183/+84
Now that the `std::env` module has had some time to bake this commit marks most of its APIs as `#[stable]`. Some notable APIs that are **not** stable (and still use the same `env` feature gate) are: * `{set,get}_exit_status` - there are still questions about whether this is the right interface for setting/getting the exit status of a process. * `page_size` - this may change location in the future or perhaps name as well. This also effectively closes #22122 as the variants of `VarError` are `#[stable]` now. (this is done intentionally)
2015-02-28Auto merge of #22839 - lifthrasiir:better-backtrace, r=alexcrichtonbors-10/+107
Fixes #20978 for supported platforms (i.e. non-Android POSIX). This uses `backtrace_pcinfo` to inspect the DWARF debug info and list the file and line pairs for given stack frame. Such pair is not unique due to the presence of inlined functions and the updated routine correctly handles this case. The code is modelled after libbacktrace's `backtrace_full` routine. There is one known issue with this approach. Macros, when invoked, take over the current frame and shadows the file and line pair which has invoked a macro. In particular, this makes many panicking macros a bit harder to inspect. This really is a debuginfo problem, and the backtrace routine should print them correctly with a correct debuginfo. Some example trace: ``` thread '<main>' panicked at 'explicit panic', /home/arachneng/Works/git/rust/src/test/run-pass/backtrace-debuginfo.rs:74 stack backtrace: 1: 0xd964702f - sys::backtrace::write::h32d93fffb64131b2yxC 2: 0xd9670202 - panicking::on_panic::h3a4fcb37b873aefeooM 3: 0xd95b396a - rt::unwind::begin_unwind_inner::h576b3df5f626902dJ2L 4: 0xd9eb88df - rt::unwind::begin_unwind::h16852273847167740350 5: 0xd9eb8afb - aux::callback::h15056955655605709172 at /home/arachneng/Works/git/rust/<std macros>:3 at src/test/run-pass/backtrace-debuginfo-aux.rs:15 6: 0xd9eb8caa - outer::h2cf96412459fceb6ema at src/test/run-pass/backtrace-debuginfo.rs:73 at src/test/run-pass/backtrace-debuginfo.rs:88 7: 0xd9ebab24 - main::h3f701287441442edasa at src/test/run-pass/backtrace-debuginfo.rs:134 8: 0xd96daba8 - rust_try_inner 9: 0xd96dab95 - rust_try 10: 0xd9671af4 - rt::lang_start::h7da0de9529b4c394liM 11: 0xd8f3aec4 - __libc_start_main 12: 0xd9eb8148 - <unknown> 13: 0xffffffff - <unknown> ```
2015-02-27remove leftover annotationsJorge Aparicio-2/+2
2015-02-27std: Deprecated the `old_io::extensions` moduleAlex Crichton-0/+4
The `u64_from_be_bytes` and `u64_to_be_bytes` functions are being deprecated with no replacement for now. [breaking-change]
2015-02-27std: Stabilize the `env` moduleAlex Crichton-183/+84
Now that the `std::env` module has had some time to bake this commit marks most of its APIs as `#[stable]`. Some notable APIs that are **not** stable (and still use the same `env` feature gate) are: * `{set,get}_exit_status` - there are still questions about whether this is the right interface for setting/getting the exit status of a process. * `page_size` - this may change location in the future or perhaps name as well. This also effectively closes #22122 as the variants of `VarError` are `#[stable]` now. (this is done intentionally)
2015-02-28std: Fixed backtrace warnings and tests for non-Linux platforms.Kang Seonghoon-1/+2
- Fixed a couple of dead code warnings in std::sys::backtrace. - Made `backtrace-debuginfo` test a no-op on non-Linux platforms. - `backtrace-debuginfo` is no longer tested on pretty-rpass.
2015-02-27Rollup merge of #22835 - tshepang:remove-some-warnings, r=jakub-Manish Goregaokar-6/+6
2015-02-27Rollup merge of #22788 - vadimcn:fix-precise_time_ns, r=pnkfelixManish Goregaokar-2/+25
which starts happening after ~2 hours of machine uptime. Closes #17845
2015-02-27Rollup merge of #22846 - dhuseby:bitrig-cleanup, r=alexcrichtonManish Goregaokar-15/+1
This patch contains a couple time fixes to make Rust compile on Bitrig again. This does not affect OpenBSD.
2015-02-27Rollup merge of #22803 - huonw:field-stability, r=alexcrichtonManish Goregaokar-1/+4
We were recording stability attributes applied to fields in the compiler, and even annotating it in the libs, but the compiler didn't actually do the checks to give errors/warnings in user crates. Details in the commit messages.
2015-02-27Auto merge of #22573 - nwin:impl-debug-rwlock-weak, r=Manishearthbors-0/+28
Implements `Debug` for `RwLock` and `arc::Weak` in the same way it is implemented for `rc::Weak` (basically copy & paste). The lack of this implementation prevents the automatic implementation of `Debug` for structs containing members of these types.
2015-02-26std: Draw from the same port pool during testsAlex Crichton-2/+2
Instead of allocating the same ports for ipv4 and ipv6 tests, instead draw all ports from the same pool. Some tests connect to just "localhost" on a particular port which may accidentally be interacting with other tests as the ipv-what-ness isn't specified with the string "localhost" Relevant logs: * [Deadlock of the `net::tcp::tests::listen_localhost` test][mac] * [Failure of the `fast_rebind` test][win1] * [Failure of `multiple_connect_interleaved_lazy_schedule_ip4`][win2] [mac]: https://gist.github.com/alexcrichton/349c7ce7c620c1adb2f2 [win1]: https://gist.github.com/alexcrichton/7e3611faae2e1edaee6f [win2]: https://gist.github.com/alexcrichton/4f5f87749af3ad0f9851
2015-02-27Add some missing stability attributes on struct fields.Huon Wilson-1/+3
2015-02-26Auto merge of #22825 - semarie:openbsd-pathbuf, r=alexcrichtonbors-1/+2
unbreak openbsd/bitrig build after 2d200c9c (the complete build/check on openbsd is in progress) @dhuseby maybe this one is in your list ?
2015-02-26fixing a few bitrig build breakersDave Huseby-15/+1
2015-02-27std: Include line numbers in backtraces.Kang Seonghoon-10/+106
Fixes #20978 for supported platforms (i.e. non-Android POSIX). This uses `backtrace_pcinfo` to inspect the DWARF debug info and list the file and line pairs for given stack frame. Such pair is not unique due to the presence of inlined functions and the updated routine correctly handles this case. The code is modelled after libbacktrace's `backtrace_full` routine. There is one known issue with this approach. Macros, when invoked, take over the current frame and shadows the file and line pair which has invoked a macro. In particular, this makes many panicking macros a bit harder to inspect. This really is a debuginfo problem, and the backtrace routine should print them correctly with a correct debuginfo.
2015-02-26Implement `Debug` for `RwLock`, `arc::Weak` and `Mutex`nwin-0/+28
2015-02-26Auto merge of #22810 - japaric:cow-path, r=alexcrichtonbors-1/+33
The Path/PathBuf pair already implements the required `Borrow`/`ToOwned` traits and can be used in a `Cow` pointer, so why not? r? @alexcrichton
2015-02-26Check stability of struct fields.Huon Wilson-0/+1
We were recording stability attributes applied to fields in the compiler, and even annotating it in the libs, but the compiler didn't actually do the checks to give errors/warnings in user crates.
2015-02-26remove some compiler warningsTshepang Lekhonkhobe-6/+6
2015-02-26path -> PathBuf for openbsd/bitrigSébastien Marie-1/+2
2015-02-25Fix overflow in precise_time_ns() on Windows,Vadim Chugunov-2/+25
which starts happening after ~2 hours of machine uptime.
2015-02-25impl IntoCow for Path[Buf]Jorge Aparicio-1/+33
2015-02-25Path -> PathBuf for Windows test (fixup #22727)Manish Goregaokar-1/+1
2015-02-25path -> PathBuf for osx/dragonfly (fixup #22727)Manish Goregaokar-11/+11
2015-02-25Assert is internal now (fixup #22739)Manish Goregaokar-1/+1
2015-02-25Fix type inference error (fixup #22739)Manish Goregaokar-1/+1
2015-02-25allow(deprecated) for TaskPool (fixup #22783)Manish Goregaokar-0/+3
2015-02-25Rollup merge of #22744 - alexcrichton:issue-22738, r=aturonManish Goregaokar-0/+8
Currently we have a `set_mode` mutator, so this just adds the pairing of a `mode` accessor to read the value. Closes #22738
2015-02-25Rollup merge of #22742 - alexcrichton:issue-22737, r=aturonManish Goregaokar-1/+15
If the filename for a path is `None` then we know that the creation of the parent directory created the whole path so there's no need to retry the call to `create_dir`. Closes #22737
2015-02-25Rollup merge of #22729 - alexcrichton:ptr-stabilization, r=aturonManish Goregaokar-7/+8
Specifically, the following actions were takend: * The `copy_memory` and `copy_nonoverlapping_memory` functions to drop the `_memory` suffix (as it's implied by the functionality). Both functions are now marked as `#[stable]`. * The `set_memory` function was renamed to `write_bytes` and is now stable. * The `zero_memory` function is now deprecated in favor of `write_bytes` directly. * The `Unique` pointer type is now behind its own feature gate called `unique` to facilitate future stabilization. [breaking-change]
2015-02-25Rollup merge of #22727 - alexcrichton:prep-env, r=aturonManish Goregaokar-91/+262
This commit moves `std::env` away from the `std::old_io` error type as well as the `std::old_path` module. Methods returning an error now return `io::Error` and methods consuming or returning paths use `std::path` instead of `std::old_path`. This commit does not yet mark these APIs as `#[stable]`. This commit also migrates `std::old_io::TempDir` to `std::fs::TempDir` with essentially the exact same API. This type was added to interoperate with the new path API and has its own `tempdir` feature. Finally, this commit reverts the deprecation of `std::os` APIs returning the old path API types. This deprecation can come back once the entire `std::old_path` module is deprecated. [breaking-change]
2015-02-25Rollup merge of #22596 - alexcrichton:fix-some-impls, r=huonwManish Goregaokar-25/+41
This commit removes many unnecessary `unsafe impl` blocks as well as pushing the needed implementations to the lowest level possible. I noticed that the bounds for `RwLock` are a little off when reviewing #22574 and wanted to ensure that we had our story straight on these implementations.
2015-02-25Rollup merge of #22157 - tbu-:pr_debug_collections, r=alexcrichtonManish Goregaokar-7/+7
r? @Gankro
2015-02-25Rollup merge of #22783 - alexcrichton:deprecate-taskpool, r=alexcrichtonManish Goregaokar-5/+5
Rather than stabilize on the current API, we're going to punt this concern to crates.io, to allow for faster iteration. [breaking-change]
2015-02-24std: Move std::env to the new I/O APIsAlex Crichton-91/+262
This commit moves `std::env` away from the `std::old_io` error type as well as the `std::old_path` module. Methods returning an error now return `io::Error` and methods consuming or returning paths use `std::path` instead of `std::old_path`. This commit does not yet mark these APIs as `#[stable]`. This commit also migrates `std::old_io::TempDir` to `std::fs::TempDir` with essentially the exact same API. This type was added to interoperate with the new path API and has its own `tempdir` feature. Finally, this commit reverts the deprecation of `std::os` APIs returning the old path API types. This deprecation can come back once the entire `std::old_path` module is deprecated. [breaking-change]
2015-02-24Modify collection's `Debug` output to resemble in their content onlyTobias Bucher-7/+7
2015-02-24std: Recomend threadpool on crates.io for TaskPoolAlex Crichton-2/+2
2015-02-24std: Stabilize some `ptr` functionsAlex Crichton-7/+8
Specifically, the following actions were taken: * The `copy_memory` and `copy_nonoverlapping_memory` functions to drop the `_memory` suffix (as it's implied by the functionality). Both functions are now marked as `#[stable]`. * The `set_memory` function was renamed to `write_bytes` and is now stable. * The `zero_memory` function is now deprecated in favor of `write_bytes` directly. * The `Unique` pointer type is now behind its own feature gate called `unique` to facilitate future stabilization. * All type parameters now are `T: ?Sized` wherever possible and new clauses were added to the `offset` functions to require that the type is sized. [breaking-change]
2015-02-25Rollup merge of #22778 - mzabaluev:leftover-lifetime, r=alexcrichtonManish Goregaokar-1/+1
2015-02-25Rollup merge of #22772 - tbu-:pr_panic_fail, r=alexcrichtonManish Goregaokar-1/+1
2015-02-25Rollup merge of #22770 - vhbit:ios-rand-send, r=alexcrichtonManish Goregaokar-4/+1
"body": null,
2015-02-25Rollup merge of #22758 - ejjeong:aarch64-linux-android, r=alexcrichtonManish Goregaokar-2/+19
This commit has already been merged in #21774, but i think it has been accidently overriden by #22584 and #22480. r? @alexcrichton