about summary refs log tree commit diff
path: root/src/libstd/sync/mpsc/select.rs
AgeCommit message (Collapse)AuthorLines
2016-01-26Fix warnings during testsAlex Crichton-1/+1
The deny(warnings) attribute is now enabled for tests so we need to weed out these warnings as well.
2016-01-14std::sync::mpsc: Add fmt::Debug stubsOlaf Buddenhagen-0/+30
Minimal fix for https://github.com/rust-lang/rust/issues/30563 This covers all the public structs I think; except for Iter and IntoIter, which I don't know if or how they should be handled.
2015-08-15std: Add issues to all unstable featuresAlex Crichton-1/+2
2015-08-11Register new snapshotsAlex Crichton-3/+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-1/+2
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-27Show appropriate feature flags in docsSteve Klabnik-2/+4
2015-06-17std: Split the `std_misc` featureAlex Crichton-3/+3
2015-05-09Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-1/+1
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-28Register new snapshotsTamir Duberstein-2/+0
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-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-2/+2
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-23Add #![feature] attributes to doctestsBrian Anderson-0/+2
2015-03-11Example -> ExamplesSteve Klabnik-1/+1
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-02Use `const`s instead of `static`s where appropriateFlorian Zeitz-1/+1
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-24Fix integers in tests (fixup #22700)Manish Goregaokar-1/+1
2015-02-23int audit - std::syncNick Cameron-30/+30
2015-02-21Remove `'static` bound from sync::mpsc, Mutex and RwLock.Huon Wilson-3/+3
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-8/+8
2015-02-17rollup merge of #22319: huonw/send-is-not-staticAlex Crichton-3/+3
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-17Fallout from stabilizationAaron Turon-21/+21
2015-02-18Update the libraries to reflect Send loosing the 'static bound.Huon Wilson-3/+3
In most places this preserves the current API by adding an explicit `'static` bound. Notably absent are some impls like `unsafe impl<T: Send> Send for Foo<T>` and the `std::thread` module. It is likely that it will be possible to remove these after auditing the code to ensure restricted lifetimes are safe. More progress on #22251.
2015-02-13Improve documentation for `Select::new()`.Steve Klabnik-4/+11
Remove incorrect claim, add example, reformat and re-word. Fixes #22266
2015-02-11rustc: Fix a number of stability lint holesAlex Crichton-3/+3
There are a number of holes that the stability lint did not previously cover, including: * Types * Bounds on type parameters on functions and impls * Where clauses * Imports * Patterns (structs and enums) These holes have all been fixed by overriding the `visit_path` function on the AST visitor instead of a few specialized cases. This change also necessitated a few stability changes: * The `collections::fmt` module is now stable (it was already supposed to be). * The `thread_local::imp::Key` type is now stable (it was already supposed to be). * The `std::rt::{begin_unwind, begin_unwind_fmt}` functions are now stable. These are required via the `panic!` macro. * The `std::old_io::stdio::{println, println_args}` functions are now stable. These are required by the `print!` and `println!` macros. * The `ops::{FnOnce, FnMut, Fn}` traits are now `#[stable]`. This is required to make bounds with these traits stable. Note that manual implementations of these traits are still gated by default, this stability only allows bounds such as `F: FnOnce()`. Additionally, the compiler now has special logic to ignore its own generated `__test` module for the `--test` harness in terms of stability. Closes #8962 Closes #16360 Closes #20327 [breaking-change]
2015-01-30Remove all `i` suffixesTobias Bucher-4/+4
2015-01-29`for x in range(a, b)` -> `for x in a..b`Jorge Aparicio-10/+10
sed -i 's/in range(\([^,]*\), *\([^()]*\))/in \1\.\.\2/g' **/*.rs
2015-01-25Merge remote-tracking branch 'rust-lang/master'Brian Anderson-34/+7
Conflicts: mk/tests.mk src/liballoc/arc.rs src/liballoc/boxed.rs src/liballoc/rc.rs src/libcollections/bit.rs src/libcollections/btree/map.rs src/libcollections/btree/set.rs src/libcollections/dlist.rs src/libcollections/ring_buf.rs src/libcollections/slice.rs src/libcollections/str.rs src/libcollections/string.rs src/libcollections/vec.rs src/libcollections/vec_map.rs src/libcore/any.rs src/libcore/array.rs src/libcore/borrow.rs src/libcore/error.rs src/libcore/fmt/mod.rs src/libcore/iter.rs src/libcore/marker.rs src/libcore/ops.rs src/libcore/result.rs src/libcore/slice.rs src/libcore/str/mod.rs src/libregex/lib.rs src/libregex/re.rs src/librustc/lint/builtin.rs src/libstd/collections/hash/map.rs src/libstd/collections/hash/set.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/mutex.rs src/libstd/sync/poison.rs src/libstd/sync/rwlock.rs src/libsyntax/feature_gate.rs src/libsyntax/test.rs
2015-01-23Set unstable feature names appropriatelyBrian Anderson-1/+1
* `core` - for the core crate * `hash` - hashing * `io` - io * `path` - path * `alloc` - alloc crate * `rand` - rand crate * `collections` - collections crate * `std_misc` - other parts of std * `test` - test crate * `rustc_private` - everything else
2015-01-21Remove 'since' from unstable attributesBrian Anderson-1/+1
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-6/+7
2015-01-21rollup merge of #21444: petrochenkov/nullAlex Crichton-7/+7
Conflicts: src/libstd/sync/mpsc/select.rs
2015-01-20Register snapshot for 9006c3cFlavio Percoco-27/+0
2015-01-19Replace `0 as *const/mut T` with `ptr::null/null_mut()`we-8/+9
2015-01-16Don't use NoSend/NoSync in libstdFlavio Percoco-0/+28
2015-01-08Improvements to feature stagingBrian Anderson-1/+1
This gets rid of the 'experimental' level, removes the non-staged_api case (i.e. stability levels for out-of-tree crates), and lets the staged_api attributes use 'unstable' and 'deprecated' lints. This makes the transition period to the full feature staging design a bit nicer.
2015-01-07markers -> markerNick Cameron-3/+3
2015-01-07Change `std::kinds` to `std::markers`; flatten `std::kinds::marker`Nick Cameron-3/+3
[breaking-change]
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-1/+1
2015-01-03sed -i -s 's/\bmod,/self,/g' **/*.rsJorge Aparicio-1/+1
2015-01-03std: fix falloutJorge Aparicio-1/+3
2015-01-02Rollup test fixes and rebase conflictsAlex Crichton-1/+0
2014-12-29std: Second pass stabilization for `comm`Alex Crichton-0/+747
This commit is a second pass stabilization for the `std::comm` module, performing the following actions: * The entire `std::comm` module was moved under `std::sync::mpsc`. This movement reflects that channels are just yet another synchronization primitive, and they don't necessarily deserve a special place outside of the other concurrency primitives that the standard library offers. * The `send` and `recv` methods have all been removed. * The `send_opt` and `recv_opt` methods have been renamed to `send` and `recv`. This means that all send/receive operations return a `Result` now indicating whether the operation was successful or not. * The error type of `send` is now a `SendError` to implement a custom error message and allow for `unwrap()`. The error type contains an `into_inner` method to extract the value. * The error type of `recv` is now `RecvError` for the same reasons as `send`. * The `TryRecvError` and `TrySendError` types have had public reexports removed of their variants and the variant names have been tweaked with enum namespacing rules. * The `Messages` iterator is renamed to `Iter` This functionality is now all `#[stable]`: * `Sender` * `SyncSender` * `Receiver` * `std::sync::mpsc` * `channel` * `sync_channel` * `Iter` * `Sender::send` * `Sender::clone` * `SyncSender::send` * `SyncSender::try_send` * `SyncSender::clone` * `Receiver::recv` * `Receiver::try_recv` * `Receiver::iter` * `SendError` * `RecvError` * `TrySendError::{mod, Full, Disconnected}` * `TryRecvError::{mod, Empty, Disconnected}` * `SendError::into_inner` * `TrySendError::into_inner` This is a breaking change due to the modification of where this module is located, as well as the changing of the semantics of `send` and `recv`. Most programs just need to rename imports of `std::comm` to `std::sync::mpsc` and add calls to `unwrap` after a send or a receive operation. [breaking-change]