about summary refs log tree commit diff
path: root/src/libstd/sys
AgeCommit message (Collapse)AuthorLines
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 #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-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-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-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-25Rollup merge of #22744 - alexcrichton:issue-22738, r=aturonManish Goregaokar-0/+4
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 #22727 - alexcrichton:prep-env, r=aturonManish Goregaokar-57/+69
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-9/+33
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-24std: Move std::env to the new I/O APIsAlex Crichton-57/+69
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 #22772 - tbu-:pr_panic_fail, r=alexcrichtonManish Goregaokar-1/+1
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
2015-02-25Rollup merge of #22739 - tbu-:pr_error_net, r=alexcrichtonManish Goregaokar-31/+37
This affects the `set_non_blocking` function which cannot fail for Unix or Windows, given correct parameters. Additionally, the short UDP write error case has been removed as there is no such thing as \"short UDP writes\", instead, the operating system will error out if the application tries to send a packet larger than the MTU of the network path.
2015-02-24Use arrays instead of vectors in testsVadim Petrochenkov-3/+3
2015-02-24Improve readability of an error check in `set_non_blocking`Tobias Bucher-5/+5
2015-02-24Revert a wrong replace of "fail" to "panic"Tobias Bucher-1/+1
2015-02-24Replace deprecated getdtablesize() with sysconf(_SC_OPEN_MAX) for android ↵Eunji Jeong-2/+19
aarch64
2015-02-24Rollup merge of #22594 - alexcrichton:issue-22577, r=aturonManish Goregaokar-25/+47
The windows/unix modules were currently inconsistent about the traits being implemented for `DirEntry` and there isn't much particular reason why the traits *couldn't* be implemented for `ReadDir` and `DirEntry`, so this commit ensures that they are implemented. Closes #22577
2015-02-23std: Expose a `mode` accessor for Permissions on unixAlex Crichton-0/+4
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-23Hide unnecessary error checking from the userTobias Bucher-29/+35
This affects the `set_non_blocking` function which cannot fail for Unix or Windows, given correct parameters. Additionally, the short UDP write error case has been removed as there is no such thing as "short UDP writes", instead, the operating system will error out if the application tries to send a packet larger than the MTU of the network path.
2015-02-23Test fixes and rebase conflictsAlex Crichton-2/+0
2015-02-23Fix windows failure (fixup #22538)Manish Goregaokar-2/+2
2015-02-23Use boxed functions instead of transmuteStepan Koltsov-10/+16
... to convert between Box and raw pointers. E. g. use ``` let b: Box<Foo> = Box::from_raw(p); ``` instead of ``` let b: Box<Foo> = mem::transmute(p); ``` Patch also changes closure release code in `src/libstd/sys/unix/thread.rs` when `pthread_create` failed. Raw pointer was transmuted to box of `FnOnce()` instead of `Thunk`. This code was probably never executed, because `pthread_create` rarely fails in practice.
2015-02-22Rollup merge of #22584 - alexcrichton:snapshots, r=GankroManish Goregaokar-479/+0
2015-02-22Rollup merge of #22568 - semarie:openbsd-rfc592, r=huonwManish Goregaokar-1/+1
The commit 1860ee52 has break the openbsd build. Repair it.
2015-02-21Auto merge of #21959 - dhuseby:bitrig-support, r=brsonbors-22/+150
This patch adds the necessary pieces to support rust on Bitrig https://bitrig.org
2015-02-20Register new snapshotsAlex Crichton-479/+0
2015-02-20std: Tidy up some `unsafe impl`s for `sync`Alex Crichton-9/+33
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-20std: Ensure fs::{DirEntry, ReadDir} are Send/SyncAlex Crichton-25/+47
The windows/unix modules were currently inconsistent about the traits being implemented for `DirEntry` and there isn't much particular reason why the traits *couldn't* be implemented for `ReadDir` and `DirEntry`, so this commit ensures that they are implemented. Closes #22577
2015-02-20unbreak openbsd build after 1860ee52Sébastien Marie-1/+1
The commit 1860ee52 has break the openbsd build. Repair it.
2015-02-19Round 8 tex fixesManish Goregaokar-1/+1
2015-02-19Round 5 test fixes and rebase conflictsAlex Crichton-3/+32
2015-02-18Round 4 test fixes and rebase conflictsAlex Crichton-2/+166
2015-02-18rollup merge of #22502: nikomatsakis/deprecate-bracket-bracketAlex Crichton-8/+8
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/librustc/middle/lang_items.rs src/librustc_back/rpath.rs src/librustc_typeck/check/regionck.rs src/libstd/ffi/os_str.rs src/libsyntax/diagnostic.rs src/libsyntax/parse/parser.rs src/libsyntax/util/interner.rs src/test/run-pass/regions-refcell.rs
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-8/+8
2015-02-18rollup merge of #22497: nikomatsakis/suffixesAlex Crichton-4/+4
Conflicts: src/librustc_trans/trans/tvec.rs
2015-02-18rollup merge of #22491: Gankro/into_iterAlex Crichton-4/+5
Conflicts: src/libcollections/bit.rs src/libcollections/linked_list.rs src/libcollections/vec_deque.rs src/libstd/sys/common/wtf8.rs
2015-02-18rollup merge of #22482: alexcrichton/cstr-changesAlex Crichton-86/+94
This commit is an implementation of [RFC 592][r592] and [RFC 840][r840]. These two RFCs tweak the behavior of `CString` and add a new `CStr` unsized slice type to the module. [r592]: https://github.com/rust-lang/rfcs/blob/master/text/0592-c-str-deref.md [r840]: https://github.com/rust-lang/rfcs/blob/master/text/0840-no-panic-in-c-string.md The new `CStr` type is only constructable via two methods: 1. By `deref`'ing from a `CString` 2. Unsafely via `CStr::from_ptr` The purpose of `CStr` is to be an unsized type which is a thin pointer to a `libc::c_char` (currently it is a fat pointer slice due to implementation limitations). Strings from C can be safely represented with a `CStr` and an appropriate lifetime as well. Consumers of `&CString` should now consume `&CStr` instead to allow producers to pass in C-originating strings instead of just Rust-allocated strings. A new constructor was added to `CString`, `new`, which takes `T: IntoBytes` instead of separate `from_slice` and `from_vec` methods (both have been deprecated in favor of `new`). The `new` method returns a `Result` instead of panicking. The error variant contains the relevant information about where the error happened and bytes (if present). Conversions are provided to the `io::Error` and `old_io::IoError` types via the `FromError` trait which translate to `InvalidInput`. This is a breaking change due to the modification of existing `#[unstable]` APIs and new deprecation, and more detailed information can be found in the two RFCs. Notable breakage includes: * All construction of `CString` now needs to use `new` and handle the outgoing `Result`. * Usage of `CString` as a byte slice now explicitly needs a `.as_bytes()` call. * The `as_slice*` methods have been removed in favor of just having the `as_bytes*` methods. Closes #22469 Closes #22470 [breaking-change]
2015-02-18std: Implement CString-related RFCsAlex Crichton-86/+94
This commit is an implementation of [RFC 592][r592] and [RFC 840][r840]. These two RFCs tweak the behavior of `CString` and add a new `CStr` unsized slice type to the module. [r592]: https://github.com/rust-lang/rfcs/blob/master/text/0592-c-str-deref.md [r840]: https://github.com/rust-lang/rfcs/blob/master/text/0840-no-panic-in-c-string.md The new `CStr` type is only constructable via two methods: 1. By `deref`'ing from a `CString` 2. Unsafely via `CStr::from_ptr` The purpose of `CStr` is to be an unsized type which is a thin pointer to a `libc::c_char` (currently it is a fat pointer slice due to implementation limitations). Strings from C can be safely represented with a `CStr` and an appropriate lifetime as well. Consumers of `&CString` should now consume `&CStr` instead to allow producers to pass in C-originating strings instead of just Rust-allocated strings. A new constructor was added to `CString`, `new`, which takes `T: IntoBytes` instead of separate `from_slice` and `from_vec` methods (both have been deprecated in favor of `new`). The `new` method returns a `Result` instead of panicking. The error variant contains the relevant information about where the error happened and bytes (if present). Conversions are provided to the `io::Error` and `old_io::IoError` types via the `FromError` trait which translate to `InvalidInput`. This is a breaking change due to the modification of existing `#[unstable]` APIs and new deprecation, and more detailed information can be found in the two RFCs. Notable breakage includes: * All construction of `CString` now needs to use `new` and handle the outgoing `Result`. * Usage of `CString` as a byte slice now explicitly needs a `.as_bytes()` call. * The `as_slice*` methods have been removed in favor of just having the `as_bytes*` methods. Closes #22469 Closes #22470 [breaking-change]
2015-02-18make FromIterator use IntoIteratorAlexis-2/+2
This breaks all implementors of FromIterator, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument). Users of FromIterator should be unaffected because Iterators are IntoIterator. [breaking-change]
2015-02-18make Extend use IntoIteratorAlexis-2/+3
This breaks all implementors of Extend, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument). Users of Extend should be unaffected because Iterators are IntoIterator. [breaking-change]
2015-02-18std: Stabilize the `hash` moduleAlex Crichton-2/+277
This commit is an implementation of [RFC 823][rfc] which is another pass over the `std::hash` module for stabilization. The contents of the module were not entirely marked stable, but some portions which remained quite similar to the previous incarnation are now marked `#[stable]`. Specifically: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0823-hash-simplification.md * `std::hash` is now stable (the name) * `Hash` is now stable * `Hash::hash` is now stable * `Hasher` is now stable * `SipHasher` is now stable * `SipHasher::new` and `new_with_keys` are now stable * `Hasher for SipHasher` is now stable * Many `Hash` implementations are now stable All other portions of the `hash` module remain `#[unstable]` as they are less commonly used and were recently redesigned. This commit is a breaking change due to the modifications to the `std::hash` API and more details can be found on the [RFC][rfc]. Closes #22467 [breaking-change]
2015-02-18Remove `i`, `is`, `u`, or `us` suffixes that are not necessary.Niko Matsakis-4/+4
2015-02-18 Manual merge of #22475 - alexcrichton:rollup, r=alexcrichtonHuon Wilson-16/+34
One windows bot failed spuriously.
2015-02-17rollup merge of #22319: huonw/send-is-not-staticAlex Crichton-1/+1
Conflicts: src/libstd/sync/task_pool.rs src/libstd/thread.rs src/libtest/lib.rs src/test/bench/shootout-reverse-complement.rs src/test/bench/shootout-spectralnorm.rs
2015-02-17Test fixes and rebase conflictsAlex Crichton-1/+2