about summary refs log tree commit diff
path: root/src/libsync
AgeCommit message (Collapse)AuthorLines
2014-09-23Deprecate `#[ignore(cfg(...))]`Steven Fackler-1/+1
Replace `#[ignore(cfg(a, b))]` with `#[cfg_attr(all(a, b), ignore)]`
2014-09-16Fallout from renamingAaron Turon-25/+25
2014-09-16Align with _mut conventionsAaron Turon-1/+1
As per [RFC 52](https://github.com/rust-lang/rfcs/blob/master/active/0052-ownership-variants.md), use `_mut` suffixes to mark mutable variants, and `into_iter` for moving iterators. [breaking-change]
2014-09-15silence various warnings in stdlib, no idea why they suddenly startedNiko Matsakis-11/+11
2014-09-09Remove some test warnings.Jonas Hietala-1/+1
2014-08-29Register new snapshotsAlex Crichton-71/+0
2014-08-28auto merge of #16664 : aturon/rust/stabilize-option-result, r=alexcrichtonbors-8/+8
Per API meeting https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-13.md # Changes to `core::option` Most of the module is marked as stable or unstable; most of the unstable items are awaiting resolution of conventions issues. However, a few methods have been deprecated, either due to lack of use or redundancy: * `take_unwrap`, `get_ref` and `get_mut_ref` (redundant, and we prefer for this functionality to go through an explicit .unwrap) * `filtered` and `while` * `mutate` and `mutate_or_set` * `collect`: this functionality is being moved to a new `FromIterator` impl. # Changes to `core::result` Most of the module is marked as stable or unstable; most of the unstable items are awaiting resolution of conventions issues. * `collect`: this functionality is being moved to a new `FromIterator` impl. * `fold_` is deprecated due to lack of use * Several methods found in `core::option` are added here, including `iter`, `as_slice`, and variants. Due to deprecations, this is a: [breaking-change]
2014-08-28Fallout from stabilizing core::optionAaron Turon-8/+8
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-22/+69
2014-08-27Remove invalid test -- this test reads freed memory, from what I can tellNiko Matsakis-21/+0
2014-08-26Clarify what tx and rx meanRobert Clipsham-0/+4
Add a short explanation of what tx and rx mean in terms of channels.
2014-08-18libsyntax: Remove the `use foo = bar` syntax from the language in favorPatrick Walton-3/+3
of `use bar as foo`. Change all uses of `use foo = bar` to `use bar as foo`. Implements RFC #47. Closes #16461. [breaking-change]
2014-08-16librustc: Forbid external crates, imports, and/or items from beingPatrick Walton-3/+5
declared with the same name in the same scope. This breaks several common patterns. First are unused imports: use foo::bar; use baz::bar; Change this code to the following: use baz::bar; Second, this patch breaks globs that import names that are shadowed by subsequent imports. For example: use foo::*; // including `bar` use baz::bar; Change this code to remove the glob: use foo::{boo, quux}; use baz::bar; Or qualify all uses of `bar`: use foo::{boo, quux}; use baz; ... baz::bar ... Finally, this patch breaks code that, at top level, explicitly imports `std` and doesn't disable the prelude. extern crate std; Because the prelude imports `std` implicitly, there is no need to explicitly import it; just remove such directives. The old behavior can be opted into via the `import_shadowing` feature gate. Use of this feature gate is discouraged. This implements RFC #116. Closes #16464. [breaking-change]
2014-08-13Fix various fallout from timer changesBrian Anderson-2/+4
2014-08-12Deprecation fallout in libsyncAaron Turon-0/+3
2014-08-07Rename `Share` to `Sync`Alex Crichton-18/+18
This leaves the `Share` trait at `std::kinds` via a `#[deprecated]` `pub use` statement, but the `NoShare` struct is no longer part of `std::kinds::marker` due to #12660 (the build cannot bootstrap otherwise). All code referencing the `Share` trait should now reference the `Sync` trait, and all code referencing the `NoShare` type should now reference the `NoSync` type. The functionality and meaning of this trait have not changed, only the naming. Closes #16281 [breaking-change]
2014-08-04stabilize atomics (now atomic)Aaron Turon-165/+166
This commit stabilizes the `std::sync::atomics` module, renaming it to `std::sync::atomic` to match library precedent elsewhere, and tightening up behavior around incorrect memory ordering annotations. The vast majority of the module is now `stable`. However, the `AtomicOption` type has been deprecated, since it is essentially unused and is not truly a primitive atomic type. It will eventually be replaced by a higher-level abstraction like MVars. Due to deprecations, this is a: [breaking-change]
2014-08-01Fix misspelled comments.Joseph Crail-2/+2
2014-08-01libsync: Add safer abstraction for SPSC queue.Kevin Butler-36/+143
The current spsc implementation doesn't enforce single-producer single-consumer usage and also allows unsafe memory use through peek & pop. For safer usage, `spsc_queue::queue` now returns a pair of owned objects which only allow consumer or producer behaviours through an `Arc`. Through restricting the mutability of the receiver to `mut` the peek and pop behaviour becomes safe again, with the compiler complaining about usage which could lead to problems. To fix code broken from this, update: Queue::new(x) -> unsafe { Queue::new(x) } [breaking-change]
2014-07-26std: Stabilize unit, bool, ty, tuple, arc, anyAlex Crichton-67/+67
This commit applies stability attributes to the contents of these modules, summarized here: * The `unit` and `bool` modules have become #[unstable] as they are purely meant for documentation purposes and are candidates for removal. * The `ty` module has been deprecated, and the inner `Unsafe` type has been renamed to `UnsafeCell` and moved to the `cell` module. The `marker1` field has been removed as the compiler now always infers `UnsafeCell` to be invariant. The `new` method i stable, but the `value` field, `get` and `unwrap` methods are all unstable. * The `tuple` module has its name as stable, the naming of the `TupleN` traits as stable while the methods are all #[unstable]. The other impls in the module have appropriate stability for the corresponding trait. * The `arc` module has received the exact same treatment as the `rc` module previously did. * The `any` module has its name as stable. The `Any` trait is also stable, with a new private supertrait which now contains the `get_type_id` method. This is to make the method a private implementation detail rather than a public-facing detail. The two extension traits in the module are marked #[unstable] as they will not be necessary with DST. The `is` method is #[stable], the as_{mut,ref} methods have been renamed to downcast_{mut,ref} and are #[unstable]. The extension trait `BoxAny` has been clarified as to why it is unstable as it will not be necessary with DST. This is a breaking change because the `marker1` field was removed from the `UnsafeCell` type. To deal with this change, you can simply delete the field and only specify the value of the `data` field in static initializers. [breaking-change]
2014-07-24auto merge of #15781 : alexcrichton/rust/issue-15758, r=bblumbors-0/+11
Semaphores are not currently designed to handle this case correctly, leading to very strange behavior. Semaphores as written are intended to count *resources* and it's not possible to have a negative number of resources. This alters the behavior and documentation to note that the task will be failed if the initial count is 0. Closes #15758
2014-07-23collections: Move push/pop to MutableSeqBrian Anderson-2/+2
Implement for Vec, DList, RingBuf. Add MutableSeq to the prelude. Since the collections traits are in the prelude most consumers of these methods will continue to work without change. [breaking-change]
2014-07-18sync: Fail with init semaphore count < 0Alex Crichton-0/+11
Semaphores are not currently designed to handle this case correctly, leading to very strange behavior. Semaphores as written are intended to count *resources* and it's not possible to have a negative number of resources. This alters the behavior and documentation to note that the task will be failed if the initial count is 0. Closes #15758
2014-07-17sync: Ensure try_send() wakes up receiversAlex Crichton-1/+26
This branch of try_send() just forgot to wake up any receiver waiting for data. Closes #15761
2014-07-17deprecate Vec::getNick Cameron-4/+4
2014-07-13auto merge of #15591 : aturon/rust/box-cell-stability, r=alexcrichtonbors-11/+11
This PR is the outcome of the library stabilization meeting for the `liballoc::owned` and `libcore::cell` modules. Aside from the stability attributes, there are a few breaking changes: * The `owned` modules is now named `boxed`, to better represent its contents. (`box` was unavailable, since it's a keyword.) This will help avoid the misconception that `Box` plays a special role wrt ownership. * The `AnyOwnExt` extension trait is renamed to `BoxAny`, and its `move` method is renamed to `downcast`, in both cases to improve clarity. * The recently-added `AnySendOwnExt` extension trait is removed; it was not being used and is unnecessary. [breaking-change]
2014-07-13Stabilization for `owned` (now `boxed`) and `cell`Aaron Turon-11/+11
This PR is the outcome of the library stabilization meeting for the `liballoc::owned` and `libcore::cell` modules. Aside from the stability attributes, there are a few breaking changes: * The `owned` modules is now named `boxed`, to better represent its contents. (`box` was unavailable, since it's a keyword.) This will help avoid the misconception that `Box` plays a special role wrt ownership. * The `AnyOwnExt` extension trait is renamed to `BoxAny`, and its `move` method is renamed to `downcast`, in both cases to improve clarity. * The recently-added `AnySendOwnExt` extension trait is removed; it was not being used and is unnecessary. [breaking-change]
2014-07-11Update doc URLs for version bumpBrian Anderson-1/+1
2014-07-09Register new snapshotsAlex Crichton-2/+0
Closes #15544
2014-07-05Add #[crate_name] attributes as necessaryAlex Crichton-1/+3
2014-07-04auto merge of #15343 : alexcrichton/rust/0.11.0-release, r=brsonbors-2/+2
2014-07-03Fix spelling errors.Joseph Crail-4/+4
2014-07-02Merge remote-tracking branch 'origin/master' into 0.11.0-releaseAlex Crichton-21/+60
Conflicts: src/libstd/lib.rs
2014-07-02Apply stability attributes to std::commAlex Crichton-0/+36
* channel() - #[unstable]. This will likely remain forever * sync_channel(n: int) - #[unstable with comment]. Concerns have ben raised about the usage of the term "synchronous channel" because that generally only applies to the case where n == 0. If n > 0 then these channels are often referred to as buffered channels. * Sender::send(), SyncSender::send(), Receiver::recv() - #[experimental]. These functions directly violate the general guideline of not providing a failing and non-failing variant. These functions were explicitly selected for being excused from this guideline, but recent discussions have cast doubt on that decision. These functions are #[experimental] for now until a decision is made as they are candidates for removal. * Sender::send_opt(), SyncSender::send_opt(), Receiver::recv_opt() - #[unstable with a comment]. If the above no-`_opt` functions are removed, these functions will be renamed to the non-`_opt` variants. * SyncSender::try_send(), Receiver::try_recv() - #[unstable with a comment]. These return types of these functions to not follow general conventions. They are consistent with the rest of the api, but not with the rest of the libraries. Until their return types are nailed down, these functions are #[unstable]. * Receiver::iter() - #[unstable]. This will likely remain forever. * std::com::select - #[experimental]. The functionality is likely to remain in some form forever, but it is highly unlikely to remain in its current form. It is unknown how much breakage this will cause if and when the api is redesigned, so the entire module and its components are all experimental. * DuplexStream - #[deprecated]. This type is not composable with other channels in terms of selection or other expected locations. It can also not be used with ChanWriter and ChanReader, for example. Due to it being only lightly used, and easily replaced with two channels, this type is being deprecated and slated for removal. * Clone for {,Sync}Sender - #[unstable]. This will likely remain forever.
2014-06-29librustc: Remove the fallback to `int` for integers and `f64` forPatrick Walton-15/+15
floating point numbers for real. This will break code that looks like: let mut x = 0; while ... { x += 1; } println!("{}", x); Change that code to: let mut x = 0i; while ... { x += 1; } println!("{}", x); Closes #15201. [breaking-change]
2014-06-28auto merge of #15208 : alexcrichton/rust/snapshots, r=pcwaltonbors-6/+9
This change registers new snapshots, allowing `*T` to be removed from the language. This is a large breaking change, and it is recommended that if compiler errors are seen that any FFI calls are audited to determine whether they should be actually taking `*mut T`.
2014-06-28Rename all raw pointers as necessaryAlex Crichton-6/+9
2014-06-27Update to 0.11.0 0.11.0Alex Crichton-2/+2
2014-06-24librustc: Remove cross borrowing from mutable `Box`es to `&mut`.Patrick Walton-1/+1
This will break code like: fn f(x: &mut int) {} let mut a = box 1i; f(a); Change it to: fn f(x: &mut int) {} let mut a = box 1i; f(&mut *a); RFC 33; issue #10504. [breaking-change]
2014-06-24librustc: Remove the fallback to `int` from typechecking.Niko Matsakis-138/+141
This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change]
2014-06-22Register new snapshotsAlex Crichton-1/+0
2014-06-20librustc: Put `#[unsafe_destructor]` behind a feature gate.Patrick Walton-1/+2
Closes #8142. This is not the semantics we want long-term. You can continue to use `#[unsafe_destructor]`, but you'll need to add `#![feature(unsafe_destructor)]` to the crate attributes. [breaking-change]
2014-06-19sync: Enable the fast path of select()Alex Crichton-1/+1
This was erroneously disabled as part of 065e121f and it hasn't been turned on since. This was a 3x perf improvement in a test of mine.
2014-06-19auto merge of #15014 : brson/rust/all-crates-experimental, r=cmrbors-0/+1
This creates a stability baseline for all crates that we distribute that are not `std`. In general, all library code must start as experimental and progress in stages to become stable.
2014-06-18Fallout from TaskBuilder changesAaron Turon-6/+4
This commit brings code downstream of libstd up to date with the new TaskBuilder API.
2014-06-18rustdoc: Fix testing indented code blocksAlex Crichton-1/+1
The collapse/unindent passes were run in the wrong order, generating different markdown for indented tests.
2014-06-17Mark all crates except std as experimentalBrian Anderson-0/+1
2014-06-16auto merge of #14877 : Seldaek/rust/commdocs, r=alexcrichtonbors-0/+46
Finally what I promised to do in #13862 /cc @alexcrichton
2014-06-16Add examples of how to read from a channel with a timeout, refs #13862Jordi Boggiano-0/+46
2014-06-15Register new snapshotsAlex Crichton-2/+2