about summary refs log tree commit diff
path: root/src/libstd/sys
AgeCommit message (Collapse)AuthorLines
2015-03-28cleanup: Remove unused braces in use statementsRicho Healey-1/+1
2015-03-27rollup merge of #23197: aatxe/masterAlex Crichton-2/+1
`std::dynamic_library` is currently using `std::old_io::Path` specifically. This change brings the API in alignment with `std::fs::File` by having it take `std::path::AsPath`. The Windows code should work, but I admittedly haven't tried it (I don't have a Windows machine readily available right now). r? @alexcrichton
2015-03-27Updated std::dynamic_lib to use std::path.Aaron Weiss-2/+1
2015-03-27rollup merge of #23741: alexcrichton/remove-int-uintAlex Crichton-195/+195
Conflicts: src/librustc/middle/ty.rs src/librustc_trans/trans/adt.rs src/librustc_typeck/check/mod.rs src/libserialize/json.rs src/test/run-pass/spawn-fn.rs
2015-03-27rollup merge of #23738: alexcrichton/snapshotsAlex Crichton-79/+0
Conflicts: src/libcollections/vec.rs
2015-03-27rollup merge of #23753: aturon/revise-convertAlex Crichton-8/+0
This commit revises `path` and `os_str` to use blanket impls for `From` on reference types. This both cuts down on the number of required impls, and means that you can pass through e.g. `T: AsRef<OsStr>` to `PathBuf::from` without an intermediate call to `as_ref`. It also makes a FIXME note for later generalizing the blanket impls for `AsRef` and `AsMut` to use `Deref`/`DerefMut`, once it is possible to do so.
2015-03-26Add `std::net::lookup_addr` for reverse DNS lookupMurarth-1/+38
Closes #22608
2015-03-26std: Stabilize parts of std::os::platform::ioAlex Crichton-54/+238
This commit stabilizes the platform-specific `io` modules, specifically around the traits having to do with the raw representation of each object on each platform. Specifically, the following material was stabilized: * `AsRaw{Fd,Socket,Handle}` * `RawFd` (renamed from `Fd`) * `RawHandle` (renamed from `Handle`) * `RawSocket` (renamed from `Socket`) * `AsRaw{Fd,Socket,Handle}` implementations * `std::os::{unix, windows}::io` The following material was added as `#[unstable]`: * `FromRaw{Fd,Socket,Handle}` * Implementations for various primitives There are a number of future improvements that are possible to make to this module, but this should cover a good bit of functionality desired from these modules for now. Some specific future additions may include: * `IntoRawXXX` traits to consume the raw representation and cancel the auto-destructor. * `Fd`, `Socket`, and `Handle` abstractions that behave like Rust objects and have nice methods for various syscalls. At this time though, these are considered backwards-compatible extensions and will not be stabilized at this time. This commit is a breaking change due to the addition of `Raw` in from of the type aliases in each of the platform-specific modules. [breaking-change]
2015-03-26Revise use of conversion traitsAaron Turon-8/+0
This commit revises `path` and `os_str` to use blanket impls for `From` on reference types. This both cuts down on the number of required impls, and means that you can pass through e.g. `T: AsRef<OsStr>` to `PathBuf::from` without an intermediate call to `as_ref`. It also makes a FIXME note for later generalizing the blanket impls for `AsRef` and `AsMut` to use `Deref`/`DerefMut`, once it is possible to do so.
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-195/+195
Now that support has been removed, all lingering use cases are renamed.
2015-03-26Register new snapshotsAlex Crichton-79/+0
2015-03-25std: Add net::IpAddr, destabilize lookup_hostAlex Crichton-12/+12
This commits adds back an `IpAddr` enum matching the `SocketAddr` enum, but without a port. The enumeration is `#[unstable]`. The `lookup_host` function and iterator are also destabilized behind a new feature gate due to questions around the semantics of returning `SocketAddr` values.
2015-03-25Rollup merge of #23693 - semarie:openbsd-pathbuf-new, r=nikomatsakisManish Goregaokar-2/+2
`PathBuf::new` have been changed. Use `PathBuf::from` instead. Apply the same change for freebsd too, while here.
2015-03-25Rollup merge of #23684 - tamird:ios-fallout, r=alexcrichtonManish Goregaokar-1/+1
r? @aturon cc @alexcrichton
2015-03-25unbreak bitrig/openbsd build after 8389253dSébastien Marie-2/+2
`PathBuf::new` have been changed. Use `PathBuf::from` instead. Apply the same change for freebsd too, while here.
2015-03-24[iOS] Fallout from 8389253Tamir Duberstein-1/+1
2015-03-24Test fixes and rebase conflicts, round 2Alex Crichton-3/+7
2015-03-24rollup merge of #23638: pnkfelix/fsk-reject-specialized-dropsAlex Crichton-1/+1
Reject specialized Drop impls. See Issue #8142 for discussion. This makes it illegal for a Drop impl to be more specialized than the original item. So for example, all of the following are now rejected (when they would have been blindly accepted before): ```rust struct S<A> { ... }; impl Drop for S<i8> { ... } // error: specialized to concrete type struct T<'a> { ... }; impl Drop for T<'static> { ... } // error: specialized to concrete region struct U<A> { ... }; impl<A:Clone> Drop for U<A> { ... } // error: added extra type requirement struct V<'a,'b>; impl<'a,'b:a> Drop for V<'a,'b> { ... } // error: added extra region requirement ``` Due to examples like the above, this is a [breaking-change]. (The fix is to either remove the specialization from the `Drop` impl, or to transcribe the requirements into the struct/enum definition; examples of both are shown in the PR's fixed to `libstd`.) ---- This is likely to be the last thing blocking the removal of the `#[unsafe_destructor]` attribute. Fix #8142 Fix #23584
2015-03-24rollup merge of #23630: nrc/coerce-tidyAlex Crichton-1/+1
See notes on the first commit Closes #18601 r? @nikomatsakis cc @eddyb
2015-03-24rollup merge of #23592: alexcrichton/tweak-at-exitAlex Crichton-1/+1
There have been some recent panics on the bots and this commit is an attempt to appease them. Previously it was considered invalid to run `rt::at_exit` after the handlers had already started running. Due to the multithreaded nature of applications, however, it is not always possible to guarantee this. For example [this program][ex] will show off the abort. [ex]: https://gist.github.com/alexcrichton/56300b87af6fa554e52d The semantics of the `rt::at_exit` function have been modified as such: * It is now legal to call `rt::at_exit` at any time. The return value now indicates whether the closure was successfully registered or not. Callers must now decide what to do with this information. * The `rt::at_exit` handlers will now be run for a fixed number of iterations. Common cases (such as the example shown) may end up registering a new handler while others are running perhaps once or twice, so this common condition is covered by re-running the handlers a fixed number of times, after which new registrations are forbidden. Some usage of `rt::at_exit` was updated to handle these new semantics, but deprecated or unstable libraries calling `rt::at_exit` were not updated.
2015-03-25Bug fixesNick Cameron-1/+1
2015-03-24Added `T:Send` bound to `sync::mpsc::Receiver` and `sync::mpsc::Sender`.Felix S. Klock II-1/+1
This was necessary to avoid specialized `Drop` impls for the two structs.
2015-03-23Test fixes and rebase conflicts, round 2Alex Crichton-10/+6
2015-03-23rollup merge of #23640: nagisa/thread-less-weakAlex Crichton-11/+8
This is more portable as far as linux is concerned.
2015-03-23rollup merge of #23631: andersk/minstack-dlsymAlex Crichton-14/+26
Linking `__pthread_get_minstack`, even weakly, was causing Debian’s `dpkg-shlibdeps` to detect an unnecessarily strict versioned dependency on libc6. Closes #23628.
2015-03-23rollup merge of #23601: nikomatsakis/by-value-indexAlex Crichton-0/+79
This is a [breaking-change]. When indexing a generic map (hashmap, etc) using the `[]` operator, it is now necessary to borrow explicitly, so change `map[key]` to `map[&key]` (consistent with the `get` routine). However, indexing of string-valued maps with constant strings can now be written `map["abc"]`. r? @japaric cc @aturon @Gankro
2015-03-23rollup merge of #23557: aturon/rfc-909Alex Crichton-2/+2
This commit implements [RFC 909](https://github.com/rust-lang/rfcs/pull/909): The `std::thread_local` module is now deprecated, and its contents are available directly in `std::thread` as `LocalKey`, `LocalKeyState`, and `ScopedKey`. The macros remain exactly as they were, which means little if any code should break. Nevertheless, this is technically a: [breaking-change] Closes #23547
2015-03-23Add generic conversion traitsAaron Turon-6/+5
This commit: * Introduces `std::convert`, providing an implementation of RFC 529. * Deprecates the `AsPath`, `AsOsStr`, and `IntoBytes` traits, all in favor of the corresponding generic conversion traits. Consequently, various IO APIs now take `AsRef<Path>` rather than `AsPath`, and so on. Since the types provided by `std` implement both traits, this should cause relatively little breakage. * Deprecates many `from_foo` constructors in favor of `from`. * Changes `PathBuf::new` to take no argument (creating an empty buffer, as per convention). The previous behavior is now available as `PathBuf::from`. * De-stabilizes `IntoCow`. It's not clear whether we need this separate trait. Closes #22751 Closes #14433 [breaking-change]
2015-03-23Adjust Index/IndexMut impls. For generic collections, we takeNiko Matsakis-0/+79
references. For collections whose keys are integers, we take both references and by-value.
2015-03-23Implement RFC 909: move thread_local into threadAaron Turon-2/+2
This commit implements [RFC 909](https://github.com/rust-lang/rfcs/pull/909): The `std::thread_local` module is now deprecated, and its contents are available directly in `std::thread` as `LocalKey`, `LocalKeyState`, and `ScopedKey`. The macros remain exactly as they were, which means little if any code should break. Nevertheless, this is technically a: [breaking-change] Closes #23547
2015-03-23prctl instead of pthread on linux for name setupSimonas Kazlauskas-11/+8
This is more portable as far as linux is concerned.
2015-03-23min_stack_size: clarify both reasons to use dlsymAnders Kaseorg-5/+6
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-03-23min_stack_size: update non-Linux implementation commentAnders Kaseorg-2/+2
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-03-23Get __pthread_get_minstack at runtime with dlsymAnders Kaseorg-12/+23
Linking __pthread_get_minstack, even weakly, was causing Debian’s dpkg-shlibdeps to detect an unnecessarily strict versioned dependency on libc6. Closes #23628. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-03-21std: Tweak rt::at_exit behaviorAlex Crichton-1/+1
There have been some recent panics on the bots and this commit is an attempt to appease them. Previously it was considered invalid to run `rt::at_exit` after the handlers had already started running. Due to the multithreaded nature of applications, however, it is not always possible to guarantee this. For example [this program][ex] will show off the abort. [ex]: https://gist.github.com/alexcrichton/56300b87af6fa554e52d The semantics of the `rt::at_exit` function have been modified as such: * It is now legal to call `rt::at_exit` at any time. The return value now indicates whether the closure was successfully registered or not. Callers must now decide what to do with this information. * The `rt::at_exit` handlers will now be run for a fixed number of iterations. Common cases (such as the example shown) may end up registering a new handler while others are running perhaps once or twice, so this common condition is covered by re-running the handlers a fixed number of times, after which new registrations are forbidden. Some usage of `rt::at_exit` was updated to handle these new semantics, but deprecated or unstable libraries calling `rt::at_exit` were not updated.
2015-03-21Auto merge of #23470 - alexcrichton:less-prelude, r=aturonbors-4/+7
This commit removes the reexports of `old_io` traits as well as `old_path` types and traits from the prelude. This functionality is now all deprecated and needs to be removed to make way for other functionality like `Seek` in the `std::io` module (currently reexported as `NewSeek` in the io prelude). Closes #23377 Closes #23378
2015-03-20std: Remove old_io/old_path from the preludeAlex Crichton-4/+7
This commit removes the reexports of `old_io` traits as well as `old_path` types and traits from the prelude. This functionality is now all deprecated and needs to be removed to make way for other functionality like `Seek` in the `std::io` module (currently reexported as `NewSeek` in the io prelude). Closes #23377 Closes #23378
2015-03-20Auto merge of #23512 - oli-obk:result_ok_unwrap, r=alexcrichtonbors-6/+6
because then the call to `unwrap()` will not print the error object.
2015-03-20Auto merge of #23267 - alexcrichton:issue-20012, r=aturonbors-16/+33
This reverts commit aec67c2. Closes #20012 This is temporarily rebased on #23245 as it would otherwise conflict, the last commit is the only one relevant to this PR though.
2015-03-20Revert "Revert "std: Re-enable at_exit()""Alex Crichton-16/+33
This reverts commit aec67c2ee0f673ea7b0e21c2fe7e0f26a523d823.
2015-03-20don't use Result::ok just to be able to use unwrap/unwrap_orOliver Schneider-6/+6
2015-03-19Auto merge of #23430 - alexcrichton:io-error, r=aturonbors-17/+10
This commit stabilizes the `ErrorKind` enumeration which is consumed by and generated by the `io::Error` type. The purpose of this type is to serve as a cross-platform namespace to categorize errors into. Two specific issues are addressed as part of this stablization: * The naming of each variant was scrutinized and some were tweaked. An example is how `FileNotFound` was renamed to simply `NotFound`. These names should not show either a Unix or Windows bias and the set of names is intended to grow over time. For now the names will likely largely consist of those errors generated by the I/O APIs in the standard library. * The mapping of OS error codes onto kinds has been altered. Coalescing no longer occurs (multiple error codes become one kind). It is intended that each OS error code, if bound, corresponds to only one `ErrorKind`. The current set of error kinds was expanded slightly to include some networking errors. This commit also adds a `raw_os_error` function which returns an `Option<i32>` to extract the underlying raw error code from the `Error`. Closes #16666 [breaking-change]
2015-03-19std: Stablize io::ErrorKindAlex Crichton-17/+10
This commit stabilizes the `ErrorKind` enumeration which is consumed by and generated by the `io::Error` type. The purpose of this type is to serve as a cross-platform namespace to categorize errors into. Two specific issues are addressed as part of this stablization: * The naming of each variant was scrutinized and some were tweaked. An example is how `FileNotFound` was renamed to simply `NotFound`. These names should not show either a Unix or Windows bias and the set of names is intended to grow over time. For now the names will likely largely consist of those errors generated by the I/O APIs in the standard library. * The mapping of OS error codes onto kinds has been altered. Coalescing no longer occurs (multiple error codes become one kind). It is intended that each OS error code, if bound, corresponds to only one `ErrorKind`. The current set of error kinds was expanded slightly to include some networking errors. This commit also adds a `raw_os_error` function which returns an `Option<i32>` to extract the underlying raw error code from the `Error`.
2015-03-19Auto merge of #23507 - jbcrail:fix-comment-spelling, r=alexcrichtonbors-4/+4
I corrected misspelled comments in several crates.
2015-03-19Fix spelling errors in comments.Joseph Crail-4/+4
I corrected misspelled comments in several crates.
2015-03-19Rollup merge of #23483 - semarie:openbsd-threads, r=alexcrichtonManish Goregaokar-4/+2
unbreak openbsd/bitrig build - remove `pub` from `struct` (error: visibility has no effect inside functions) - move `pthread_main_np` into function r? @alexcrichton
2015-03-19Rollup merge of #23479 - tamird:fix-ios-build, r=aturonManish Goregaokar-3/+2
r? @aturon
2015-03-18Register new snapshotsAlex Crichton-16/+0
2015-03-18iOS: fallout from 1d5983aTamir Duberstein-3/+2
2015-03-18openbsd/bitrig threadsSébastien Marie-4/+2
- remove `pub` from `struct` (visibility has no effect inside functions) - move `pthread_main_np` into function