about summary refs log tree commit diff
path: root/src/libstd/sync/mpsc
AgeCommit message (Collapse)AuthorLines
2016-01-14Require stability annotations on fields of tuple variantsVadim Petrochenkov-2/+2
2015-11-18Add missing annotations and some testsVadim Petrochenkov-1/+6
2015-10-08typos: fix a grabbag of typos all over the placeCristi Cobzarenco-1/+1
2015-09-08some more clippy-based improvementsAndre Bogus-24/+12
2015-08-15std: Add issues to all unstable featuresAlex Crichton-1/+2
2015-08-11Register new snapshotsAlex Crichton-24/+0
* Lots of core prelude imports removed * Makefile support for MSVC env vars and Rust crates removed * Makefile support for morestack removed
2015-08-09Replace many uses of `mem::transmute` with more specific functionsTobias Bucher-3/+2
The replacements are functions that usually use a single `mem::transmute` in their body and restrict input and output via more concrete types than `T` and `U`. Worth noting are the `transmute` functions for slices and the `from_utf8*` family for mutable slices. Additionally, `mem::transmute` was often used for casting raw pointers, when you can already cast raw pointers just fine with `as`.
2015-08-03syntax: Implement #![no_core]Alex Crichton-7/+15
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-07-29std: Remove the curious inner moduleAlex Crichton-2/+2
This isn't actually necessary any more with the advent of `$crate` and changes in the compiler to expand macros to `::core::$foo` in the context of a `#![no_std]` crate. The libcore inner module was also trimmed down a bit to the bare bones.
2015-07-27Show appropriate feature flags in docsSteve Klabnik-2/+4
2015-07-01Expand docs for recvSteve Klabnik-0/+42
Add an example, plus some text that covers the buffering nature of channels. Fixes #26497
2015-06-17More test fixes and fallout of stability changesAlex Crichton-4/+2
2015-06-17std: Split the `std_misc` featureAlex Crichton-7/+3
2015-05-27Use `const fn` to abstract away the contents of UnsafeCell & friends.Eduard Burtescu-2/+2
2015-05-25Remove unsafe block around boxed::into_raw() as it is now safeMichael Layzell-6/+4
2015-05-09Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-36/+36
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-05std: update select internals to not use mutable transmutingSean McArthur-11/+19
2015-04-30Add downcasting to std::error::ErrorAaron Turon-3/+3
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-11/+0
2015-04-24Change name of unit test sub-module to "tests".Johannes Oertel-3/+3
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-24Implement IntoIterator for ReceiverRaphael Speyer-0/+57
2015-04-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-3/+3
2015-04-09Indicate keyword in doc comment is code-likeCorey Farwell-2/+2
2015-04-07Remove another invalid exampleŁukasz Niemier-26/+0
2015-04-07Remove incorrect example from docsŁukasz Niemier-26/+0
2015-04-01Test fixes and rebase conflicts, round 2Alex Crichton-21/+21
2015-04-01rollup merge of #23176: huonw/rm-boundsAlex Crichton-29/+29
2015-03-31Indicate select! is code-likeCorey Farwell-1/+1
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-5/+5
Now that support has been removed, all lingering use cases are renamed.
2015-03-24Added `T:Send` bound to `Queue<T>` to avoid specialized `Drop` impl.Felix S. Klock II-1/+1
2015-03-24Added `T:Send` bound to `Packet<T>` to avoid specialized `Drop` impl.Felix S. Klock II-2/+2
2015-03-24Added `T:Send` bound to `Queue<T>` to avoid specialized Drop impl.Felix S. Klock II-2/+2
2015-03-24Added `T:Send` bound to `sync::mpsc::Receiver` and `sync::mpsc::Sender`.Felix S. Klock II-16/+16
This was necessary to avoid specialized `Drop` impls for the two structs.
2015-03-23rollup merge of #23598: brson/gateAlex Crichton-0/+4
Conflicts: src/compiletest/compiletest.rs src/libcollections/lib.rs src/librustc_back/lib.rs src/libserialize/lib.rs src/libstd/lib.rs src/libtest/lib.rs src/test/run-make/rustdoc-default-impl/foo.rs src/test/run-pass/env-home-dir.rs
2015-03-23rollup merge of #23541: aturon/stab-errorAlex Crichton-2/+2
This small commit stabilizes the `Error` trait as-is, except that `Send` and `Debug` are added as constraints. The `Send` constraint is because most uses of `Error` will be for trait objects, and by default we would like these objects to be transferrable between threads. The `Debug` constraint is to ensure that e.g. `Box<Error>` is `Debug`, and because types that implement `Display` should certainly implement `Debug` in any case. In the near future we expect to add `Any`-like downcasting features to `Error`, but this is waiting on some additional mechanisms (`Reflect`). It will be added before 1.0 via default methods. [breaking-change] r? @alexcrichton Closes #21790
2015-03-23Add #![feature] attributes to doctestsBrian Anderson-0/+4
2015-03-23Stabilize the Error traitAaron Turon-2/+2
This small commit stabilizes the `Error` trait as-is, except that `Send` and `Debug` are added as constraints. The `Send` constraint is because most uses of `Error` will be for trait objects, and by default we would like these objects to be transferrable between threads. The `Debug` constraint is to ensure that e.g. `Box<Error>` is `Debug`, and because types that implement `Display` should certainly implement `Debug` in any case. In the near future we expect to add `Any`-like downcasting features to `Error`, but this is waiting on some additional mechanisms (`Reflect`). It will be added before 1.0 via default methods. [breaking-change]
2015-03-20don't use Result::ok just to be able to use unwrap/unwrap_orOliver Schneider-1/+1
2015-03-11Example -> ExamplesSteve Klabnik-4/+4
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-08Remove unneeded `Send` bounds from `std::sync::mpsc`.Huon Wilson-29/+29
The requirements `T: Send` only matter if the channel crosses thread boundaries i.e. the `Sender` or `Reciever` are sent across thread boundaries, and which is adequately controlled by the impls of `Send` for them. If `T` doesn't satisfy the bounds, then the types cannot cross thread boundaries and so everything is still safe (the pair of types collectively behave like a `Rc<RefCell<VecDeque>>`, or something of that nature).
2015-03-06Implement std::error::Error for std::sync::mpsc error typesDan Burkert-0/+63
2015-03-03Add `: Box<_>` or `::Box<_>` type annotations to various places.Felix S. Klock II-6/+6
This is the kind of change that one is expected to need to make to accommodate overloaded-`box`. ---- Note that this is not *all* of the changes necessary to accommodate Issue 22181. It is merely the subset of those cases where there was already a let-binding in place that made it easy to add the necesasry type ascription. (For unnamed intermediate `Box` values, one must go down a different route; `Box::new` is the option that maximizes portability, but has potential inefficiency depending on whether the call is inlined.) ---- There is one place worth note, `run-pass/coerce-match.rs`, where I used an ugly form of `Box<_>` type ascription where I would have preferred to use `Box::new` to accommodate overloaded-`box`. I deliberately did not use `Box::new` here, because that is already done in coerce-match-calls.rs. ---- Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
2015-03-02Use `const`s instead of `static`s where appropriateFlorian Zeitz-5/+5
This changes the type of some public constants/statics in libunicode. Notably some `&'static &'static [(char, char)]` have changed to `&'static [(char, char)]`. The regexp crate seems to be the sole user of these, yet this is technically a [breaking-change]
2015-02-27Add some missing stability attributes on struct fields.Huon Wilson-1/+1
2015-02-24Fix integers in tests (fixup #22700)Manish Goregaokar-1/+1
2015-02-24Rollup merge of #22700 - nick29581:ints_hash, r=alexcrichtonManish Goregaokar-161/+161
fmt and hash are pretty straightforward I think. sync is a bit more complex. I thought one or two of the `isize`s ought to be `i32`s, but that would require a bunch of casting (the root cause being the lack of atomics other than isize/usize). r? @alexcrichton
2015-02-23int audit - std::syncNick Cameron-161/+161
2015-02-23Use boxed functions instead of transmuteStepan Koltsov-8/+8
... 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-21Remove `'static` bound from sync::mpsc, Mutex and RwLock.Huon Wilson-38/+38
Adds some basic tests to check that the types still catch the most glaring errors that could occur. cc #22444.
2015-02-18Remove `i`, `is`, `u`, or `us` suffixes that are not necessary.Niko Matsakis-22/+22