about summary refs log tree commit diff
path: root/src/libstd/sys/common
AgeCommit message (Collapse)AuthorLines
2015-07-01Add netbsd amd64 supportAlex Newman-0/+2
2015-06-17More test fixes and fallout of stability changesAlex Crichton-25/+1
2015-06-17std: Stabilize the sync_poison featureAlex Crichton-4/+4
These accessor/constructor methods for a `PoisonError` are quite standard for a wrapper type and enable manipulation of the underlying type.
2015-06-17std: Remove two internal `str_internals` functionsAlex Crichton-25/+0
These were just exposed to be used elsewhere at some point, but neither is currently being used so just make them private again.
2015-06-17std: Split the `std_misc` featureAlex Crichton-4/+4
2015-06-10Rollup merge of #26146 - steveklabnik:remove_unsafe_pointer, r=GankroManish Goregaokar-1/+1
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-06-09Exise 'unsafe pointer' in favor of 'raw pointer'Steve Klabnik-1/+1
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-06-09fix example in comments about demanglingAndrew Straw-1/+1
2015-06-08Auto merge of #26077 - SimonSapin:patch-6, r=alexcrichtonbors-6/+6
With the latter is provided by the `From` conversion trait, the former is now completely redundant. Their code is identical. Let’s deprecate now and plan to remove in the next cycle. (It’s `#[unstable]`.) r? @alexcrichton CC @nagisa
2015-06-08Replace usage of String::from_str with String:fromSimon Sapin-6/+6
2015-06-08Auto merge of #25823 - oli-obk:static_to_const_lint, r=alexcrichtonbors-1/+1
r? @eddyb
2015-06-07change some statics to constantsOliver 'ker' Schneider-1/+1
2015-06-03Rollup merge of #25974 - richo:stack-msg, r=alexcrichtonManish Goregaokar-8/+4
These are implemented in asm, they're just not inlined. Open questions are: * Should I just inline them? They're.. big, but it seems as though this needs violates the #[inline(always)] gaurantees the others make. * Does something (llvm?) provide these as intrinsics? The structure of this code suggests that we could be hoisting off something else, instead of flagrantly ignoring it like we do for power and mips.
2015-06-02std: clarify comments about sp* implementationsRicho Healey-8/+4
2015-05-28Implement RFC 1047 - socket timeoutsSteven Fackler-7/+39
Closes #25619
2015-05-27Use `const fn` to abstract away the contents of UnsafeCell & friends.Eduard Burtescu-46/+41
2015-05-17Make debug builders take &mut self, add entries methodSteven Fackler-10/+10
[breaking-change]
2015-05-09Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-4/+4
An automated script was run against the `.rs` and `.md` files, subsituting every occurrence of `task` with `thread`. In the `.rs` files, only the texts in the comment blocks were affected.
2015-05-07std: Remove a double-box in ReentrantMutexAlex Crichton-7/+11
Perform unsafe initialization up front and then only afterward the mutex is in place do we initialize it.
2015-05-07std: Remove unused helper_thread.rs fileAlex Crichton-170/+0
This module has been removed for quite some time!
2015-05-07std: Rename sys::foo2 modules to sys::fooAlex Crichton-1/+1
Now that `std::old_io` has been removed for quite some time the naming real estate here has opened up to allow these modules to move back to their proper names.
2015-05-03Change 'inner' field name to 'fd'/'socket' on Unix/Windows in Debug implsNick Hamann-3/+6
2015-05-03Unwrap address values in Debug implementations for ↵Nick Hamann-13/+28
TcpStream/TcpListener/UdpSocket. This now omits address fields in Debug implementations when a proper address value cannot be unwrapped.
2015-05-03Implement Debug for std::net::{UdpSocket,TcpStream,TcpListener,Shutdown}Nick Hamann-0/+29
Fixes #23134.
2015-05-01Rollup merge of #25021 - frewsxcv:an-utf, r=steveklabnikManish Goregaokar-4/+4
Even spelled out, one would say 'a Universal Character Set'
2015-04-30Replaces instanced of 'an UTF' with 'a UTF'Corey Farwell-4/+4
Even spelled out, one would say 'a Universal Character Set'
2015-04-30Add downcasting to std::error::ErrorAaron Turon-3/+4
This commit brings the `Error` trait in line with the [Error interoperation RFC](https://github.com/rust-lang/rfcs/pull/201) by adding downcasting, which has long been intended. This change means that for any `Error` trait objects that are `'static`, you can downcast to concrete error types. To make this work, it is necessary for `Error` to inherit from `Reflect` (which is currently used to mark concrete types as "permitted for reflection, aka downcasting"). This is a breaking change: it means that impls like ```rust impl<T> Error for MyErrorType<T> { ... } ``` must change to something like ```rust impl<T: Reflect> Error for MyErrorType<T> { ... } ``` except that `Reflect` is currently unstable (and should remain so for the time being). For now, code can instead bound by `Any`: ```rust impl<T: Any> Error for MyErrorType<T> { ... } ``` which *is* stable and has `Reflect` as a super trait. The downside is that this imposes a `'static` constraint, but that only constrains *when* `Error` is implemented -- it does not actually constrain the types that can implement `Error`. [breaking-change]
2015-04-28Register new snapshotsTamir Duberstein-2/+0
2015-04-27std: Don't assume thread::current() works on panicAlex Crichton-6/+5
Inspecting the current thread's info may not always work due to the TLS value having been destroyed (or is actively being destroyed). The code for printing a panic message assumed, however, that it could acquire the thread's name through this method. Instead this commit propagates the `Option` outwards to allow the `std::panicking` module to handle the case where the current thread isn't present. While it solves the immediate issue of #24313, there is still another underlying issue of panicking destructors in thread locals will abort the process. Closes #24313
2015-04-24Change name of unit test sub-module to "tests".Johannes Oertel-1/+1
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest.
2015-04-24Auto merge of #24594 - doomsplayer:patch-2, r=alexcrichtonbors-2/+6
why use dummy implementation on linux?
2015-04-23implement set_tcp_keepalive for linuxYoung Wu-2/+6
2015-04-22std: Audit std::thread implementationsAlex Crichton-14/+14
Much of this code hasn't been updated in quite some time and this commit does a small audit of the functionality: * Implementation functions now centralize all functionality on a locally defined `Thread` type. * The `detach` method has been removed in favor of a `Drop` implementation. This notably fixes leaking thread handles on Windows. * The `Thread` structure is now appropriately annotated with `Send` and `Sync` automatically on Windows and in a custom fashion on Unix. * The unsafety of creating a thread has been pushed out to the right boundaries now. Closes #24442
2015-04-21rollup merge of #24636: alexcrichton/remove-deprecatedAlex Crichton-2/+0
Conflicts: src/libcore/result.rs
2015-04-21rollup merge of #24541: alexcrichton/issue-24538Alex Crichton-1/+1
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-21std: Remove deprecated/unstable num functionalityAlex Crichton-973/+0
This commit removes all the old casting/generic traits from `std::num` that are no longer in use by the standard library. This additionally removes the old `strconv` module which has not seen much use in quite a long time. All generic functionality has been supplanted with traits in the `num` crate and the `strconv` module is supplanted with the [rust-strconv crate][rust-strconv]. [rust-strconv]: https://github.com/lifthrasiir/rust-strconv This is a breaking change due to the removal of these deprecated crates, and the alternative crates are listed above. [breaking-change]
2015-04-21Remove unused filesTamir Duberstein-971/+0
Looks like these were missed in bf4e77d.
2015-04-17std: Add Default/IntoIterator/ToOwned to the preludeAlex Crichton-1/+1
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-16deprecate Unicode functions that will be moved to crates.iokwantam-1/+1
This patch 1. renames libunicode to librustc_unicode, 2. deprecates several pieces of libunicode (see below), and 3. removes references to deprecated functions from librustc_driver and libsyntax. This may change pretty-printed output from these modules in cases involving wide or combining characters used in filenames, identifiers, etc. The following functions are marked deprecated: 1. char.width() and str.width(): --> use unicode-width crate 2. str.graphemes() and str.grapheme_indices(): --> use unicode-segmentation crate 3. str.nfd_chars(), str.nfkd_chars(), str.nfc_chars(), str.nfkc_chars(), char.compose(), char.decompose_canonical(), char.decompose_compatible(), char.canonical_combining_class(): --> use unicode-normalization crate
2015-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-2/+2
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14rollup merge of #24377: apasel422/docsAlex Crichton-45/+45
Conflicts: src/libstd/net/ip.rs src/libstd/sys/unix/fs.rs src/libstd/sys/unix/mod.rs src/libstd/sys/windows/mod.rs
2015-04-14std: Remove old_io/old_path/rand modulesAlex Crichton-91/+0
This commit entirely removes the old I/O, path, and rand modules. All functionality has been deprecated and unstable for quite some time now!
2015-04-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-45/+45
2015-04-08Implement reentrant mutexes and make stdio use themSimonas Kazlauskas-0/+422
write_fmt calls write for each formatted field. The default implementation of write_fmt is used, which will call write on not-yet-locked stdout (and write locking after), therefore making print! in multithreaded environment still interleave contents of two separate prints. This patch implements reentrant mutexes, changes stdio handles to use these mutexes and overrides write_fmt to lock the stdio handle for the whole duration of the call.
2015-04-02Tweak relese notes + rebase fixesAlex Crichton-2/+2
2015-04-01Remove `Thunk` struct and `Invoke` trait; change `Thunk` to be an aliasNiko Matsakis-1/+2
for `Box<FnBox()>`. I found the alias was still handy because it is shorter than the fully written type. This is a [breaking-change]: convert code using `Invoke` to use `FnBox`, which is usually pretty straight-forward. Code using thunk mostly works if you change `Thunk::new => Box::new` and `foo.invoke(arg)` to `foo(arg)`.
2015-03-31rollup merge of #23919: alexcrichton/stabilize-io-errorAlex Crichton-3/+2
Conflicts: src/libstd/fs/tempdir.rs src/libstd/io/error.rs
2015-03-31std: Stabilize last bits of io::ErrorAlex Crichton-3/+2
This commit stabilizes a few remaining bits of the `io::Error` type: * The `Error::new` method is now stable. The last `detail` parameter was removed and the second `desc` parameter was generalized to `E: Into<Box<Error>>` to allow creating an I/O error from any form of error. Currently there is no form of downcasting, but this will be added in time. * An implementation of `From<&str> for Box<Error>` was added to liballoc to allow construction of errors from raw strings. * The `Error::raw_os_error` method was stabilized as-is. * Trait impls for `Clone`, `Eq`, and `PartialEq` were removed from `Error` as it is not possible to use them with trait objects. This is a breaking change due to the modification of the `new` method as well as the removal of the trait implementations for the `Error` type. [breaking-change]
2015-03-31rollup merge of #23766: alexcrichton/stabilize-raw-fdAlex Crichton-0/+18
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-31rollup merge of #23549: aturon/stab-numAlex Crichton-0/+2
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change] r? @alexcrichton