From 198ca7f6aa28c08a56301ce3c1826c3e34955da7 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 19 Dec 2019 10:43:53 -0800 Subject: [PATCH 1/9] Remove rayon-futures --- .travis.yml | 5 - Cargo.toml | 2 +- appveyor.yml | 4 - ci/compat-Cargo.lock | 16 +- rayon-futures/Cargo.toml | 17 - rayon-futures/LICENSE-APACHE | 201 ------ rayon-futures/LICENSE-MIT | 25 - rayon-futures/README.md | 274 -------- .../src/compile_fail/future_escape.rs | 46 -- rayon-futures/src/compile_fail/mod.rs | 2 - rayon-futures/src/lib.rs | 624 ------------------ rayon-futures/src/test.rs | 288 -------- rayon-futures/tests/compile-fail/README.md | 11 - 13 files changed, 3 insertions(+), 1512 deletions(-) delete mode 100644 rayon-futures/Cargo.toml delete mode 100644 rayon-futures/LICENSE-APACHE delete mode 100644 rayon-futures/LICENSE-MIT delete mode 100644 rayon-futures/README.md delete mode 100644 rayon-futures/src/compile_fail/future_escape.rs delete mode 100644 rayon-futures/src/compile_fail/mod.rs delete mode 100644 rayon-futures/src/lib.rs delete mode 100644 rayon-futures/src/test.rs delete mode 100644 rayon-futures/tests/compile-fail/README.md diff --git a/.travis.yml b/.travis.yml index 6a9366323..28bb4b0f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -86,11 +86,6 @@ script: - cargo test -p rayon - cargo test -p rayon-core - ./ci/highlander.sh - - | - if [ -n "$RUSTFLAGS" ]; then - cargo build -p rayon-futures && - cargo test -p rayon-futures - fi branches: only: diff --git a/Cargo.toml b/Cargo.toml index 676fba52a..541bd6f50 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ categories = ["concurrency"] exclude = ["/ci/*", "/scripts/*", "/.travis.yml", "/appveyor.yml", "/bors.toml"] [workspace] -members = ["rayon-demo", "rayon-core", "rayon-futures"] +members = ["rayon-demo", "rayon-core"] exclude = ["ci"] [dependencies] diff --git a/appveyor.yml b/appveyor.yml index a223c7e6f..f3bf4ec96 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,10 +29,6 @@ test_script: - cargo build - cargo test -p rayon - cargo test -p rayon-core - - if not "%RUSTFLAGS%"=="%^RUSTFLAGS%" ( - cargo build -p rayon-futures && - cargo test -p rayon-futures - ) branches: only: diff --git a/ci/compat-Cargo.lock b/ci/compat-Cargo.lock index 707883b23..35201a99b 100644 --- a/ci/compat-Cargo.lock +++ b/ci/compat-Cargo.lock @@ -1,3 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. [[package]] name = "aho-corasick" version = "0.7.6" @@ -276,11 +278,6 @@ name = "fuchsia-cprng" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "futures" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "getrandom" version = "0.1.13" @@ -906,14 +903,6 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rayon-futures" -version = "0.1.0" -dependencies = [ - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon-core 1.6.1", -] - [[package]] name = "rdrand" version = "0.4.0" @@ -1311,7 +1300,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" -"checksum futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" "checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" "checksum gl_generator 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "39a23d5e872a275135d66895d954269cf5e8661d234eb1c2480f4ce0d586acbd" "checksum gl_generator 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ca98bbde17256e02d17336a6bdb5a50f7d0ccacee502e191d3e3d0ec2f96f84a" diff --git a/rayon-futures/Cargo.toml b/rayon-futures/Cargo.toml deleted file mode 100644 index 971ccdb3f..000000000 --- a/rayon-futures/Cargo.toml +++ /dev/null @@ -1,17 +0,0 @@ -[package] -name = "rayon-futures" -version = "0.1.0" # reminder to update html_root_url attribute -authors = ["Niko Matsakis ", - "Josh Stone "] -description = "Futures integration into Rayon" -edition = "2018" -license = "Apache-2.0/MIT" -repository = "https://github.com/rayon-rs/rayon" -documentation = "https://docs.rs/rayon-futures/" -readme = "README.md" -keywords = ["parallel", "thread", "concurrency", "join", "performance"] -categories = ["concurrency"] - -[dependencies] -rayon-core = { version = "1.3", path = "../rayon-core" } -futures = "0.1.16" diff --git a/rayon-futures/LICENSE-APACHE b/rayon-futures/LICENSE-APACHE deleted file mode 100644 index 16fe87b06..000000000 --- a/rayon-futures/LICENSE-APACHE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/rayon-futures/LICENSE-MIT b/rayon-futures/LICENSE-MIT deleted file mode 100644 index 25597d583..000000000 --- a/rayon-futures/LICENSE-MIT +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) 2010 The Rust Project Developers - -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/rayon-futures/README.md b/rayon-futures/README.md deleted file mode 100644 index f595a5b6b..000000000 --- a/rayon-futures/README.md +++ /dev/null @@ -1,274 +0,0 @@ -# Future integration into Rayon - -**NOTE:** `rayon-futures` currently requires unstable features of -`rayon-core`, which may only be enabled with `rustc --cfg`, -e.g. by setting `RUSTFLAGS=--cfg rayon_unstable` in the environment. - -## How futures work - -Let's start with a brief coverage of how futures work. Our example will -be a simple chain of futures: - - F_map -> F_socket - -Here `F_socket` is a future that maps to a TCP socket. It returns a -`Vec` of data read from that socket. `F_map` is a future will take -that data and do some transformation. (Note that the real futures for -reading from sockets etc do not work in this way, this is just an -example.) - -The idea of futures is that each future offers a `poll()` method. When -`poll()` is invoked, the future will attempt to execute. Typically, -this often involves recursively calling `poll()` on other futures. So, -in our example, `F_map` when it starts would call `F_socket.poll()` to -see if the data is ready. The idea is that `poll()` returns one of -three values: - -- `Ok(Async::Ready(R))` -- the future has completed, here is the result `R`. -- `Err(E)` -- the future has completed and resulted in an error `E`. -- `Ok(Async::NotReady)` -- the future is not yet complete. - -The last one is the most interesting. It means that the future is -blocked on *some event X*, typically an I/O event (i.e., we are -waiting for more data to arrive on a TCP socket). - -When a future returns `NotReady`, it also has one additional job. It -must register the "current task" (think for now of the current thread) -to be re-awoken when the event X has occurred. For most futures, this -job is delegated to another future: e.g., in our example, `F_map` -invokes `F_socket.poll()`. So if `F_socket.poll()` returns not-ready, -then it will have registered the current thread already, and hence -`F_map` can merely propagates the `NotReady` result further up. - -### The current task and executor - -A key concept of the futures.rs library is that of an *executor*. The -executor is the runtime that first invokes the top-level future -(`F_map`, in our example). This is precisely the role that Rayon -plays. Note that in any futures system there may be many -interoperating executors though. - -Part of an executor's job is to maintain some thread-local storage -(TLS) when a future is executing. In particular, it must setup the -"current task" (basically a unique integer, although it's an opaque -type) as well as an "unpark object" of type -`Arc`. [The `Unpark` trait][unpark] offers a single method -(`unpark()`) which can be invoked when the task should be -re-awoken. So `F_socket` might, for example, get the current -`Arc` object and store it for use by an I/O thread. The I/O -thread might invoke `epoll()` or `select()` or whatever and, when it -detects the socket has more data, invoke the `unpark()` method. - -[unpark]: https://docs.rs/futures/0.1/futures/executor/trait.Unpark.html - -## Rayon's futures integration - -When you spawn a future of type `F` into rayon, the idea is that it is -going to start independently executing in the thread-pool. Meanwhile, -the `spawn_future()` method returns to you your own future (let's call -it `F'`) that you can use to poll and monitor its progress. Internally -within Rayon, however, we only allocate a single `Arc` to represent -both of these things -- an `Arc>`, to be precise -- and -this `Arc` hence serves two distinct roles. - -The operations on `F'` (the handle returned to the user) are specified -by the trait `ScopeFutureTrait` and are very simple. The user can -either `poll()` the future, which is checking to see if rayon is done -executing it yet, or `cancel()` the future. `cancel()` occurs when -`F'` is dropped, which indicates that the user no longer has interest -in the result. - -### Future reference counting - -Each spawned future is represented by an `Arc`. This `Arc` actually has -some interesting structure. Each of the edges in the diagram below -represents something that is "kept alive" by holding a ref count (in -some way, usually via an `Arc`): - - F' ---+ [ deque ] --+ - | | - v v - +---> /---------------------\ - | | registry: | ------> [rayon registry] - | | contents: --------\ | - | | | scope | | ------> [spawning scope] - | | | this | | --+ (self references) - | | | ... | | | - | | \-----------------/ | | - | \---------------------/ | - +-------------------------------+ - -Let's walk through them: - -- The incoming edge from `F'` represents the edge from the future that was returned - to the caller of `spawn_future`. This ensures that the future arc will - not be freed so long as the caller is still interested in looking at - its result. -- The incoming edge from `[ deque ]` represents the fact that when the - future is enqueued into a thread-local deque (which it only - sometimes is), that deque holds a ref. This is done by transmuting - the `Arc` into a `*const Job` object (and hence the `*const` - logically holds the ref that was owned by the `Arc`). When the job - is executed, it is transmuted back and the resulting `Arc` is - eventually dropped, releasing the ref. -- The `registry` field holds onto an `Arc` and hence keeps - some central registry alive. This doesn't really do much but prevent - the `Registry` from being dropped. In particular, this doesn't - prevent the threads in a registry from terminating while the future - is unscheduled etc (though other fields in the future do). -- The `scope` field (of type `S`) is the "enclosing scope". This scope - is an abstract value that implements the `FutureScope<'scope>` trait - -- this means that it is responsible for ensuring that `'scope` does - not end until one of the `FutureScope` methods are invoked (which - occurs when the future has finished executing). For example, if the - future is spawned inside a `scope()` call, then the `S` will be a - wrapper (`ScopeFutureScope`) around a `*const Scope<'scope>`. When - the future is created one job is allocated for this future in the - scope, and the scope counter is decremented once the future is - marked as completing. - - In general, the job of the `scope` field is to ensure that the - future type (`F`) remains valid. After all, since `F: 'scope`, `F` - is known to be valid until the lifetime `'scope` ends, and that - lifetime cannot end until the `scope` methods are invoked, so we - know that `F` must stay valid until one of those methods are - invoked. - - All of our data of type `F` is stored in the field `spawn` (not - shown here). This field is always set to `None` before the scope - counter is decremented. See the section on lifetime safety for more - details. -- The `this` field stores an `Arc` which is actually - this same future. Thus the future has a ref count cycle - and cannot be freed until this cycle is broken. That field - is actually an `Option>` and will be set - to `None` once the future is complete, breaking the cycle and - allowing it to be freed when other references are dropped. - -### The future state machine - -Internally, futures go through various states, depicted here: - - PARKED <----+ - | | - v | - UNPARKED | - | | - v | - EXECUTING --+ - | | ^ - | v | - | EXECUTING_UNPARKED - | - v - COMPLETE - -When they are first created, futures begin as *PARKED*. A *PARKED* -future is one that is waiting for something to happen. It is not -scheduled in the deque of any thread. Even before we return from -`spawn_future()`, however, we will transition into *UNPARKED*. An -*UNPARKED* future is one that is waiting to be executed. It is -enqueued in the deque of some Rayon thread and hence will execute when -the thread gets around to it. - -Once the future begins to execute (it itself is a Rayon job), it -transitions into the *EXECUTING* state. This means that it is busy -calling `F.poll()`, basically. While it calls `poll()`, it also sets -up its `contents.this` field as the current "notify" instance. Hence -if `F` returns `NotReady`, it will clone the `this` field and hold -onto it to signal us the future is ready to execute again. - -For now let's assume that `F` is complete and hence returns either -`Ok(Ready(_))` or `Err(_)`. In that case, the future can transition to -`COMPLETE`. At this point, many bits of state that are no longer -needed (e.g., the future itself, but also the `this` field) -are set to `None` and dropped, and the result is stored in the -`result` field. (Moreover, we may have to signal other tasks, but that -is discussed in a future section.) - -If `F` returns `Ok(Async::NotReady)`, then we would typically -transition to the `PARKED` state and await the call to -`notify()`. When `notify()` is called, it would move the future into -the `UNPARK` state and inject it into the registry. - -However, due to the vagaries of thread-scheduling, it *can* happen -that `notify()` is called before we exit the `EXECUTING` state. For -example, we might invoke `F.poll()`, which sends the `Unpark` instance -to the I/O thread, which detects I/O, and invokes `notify()`, all -before `F.poll()` has returned. In that case, the `notify()` method -will transition the state (atomically, of course) to -`EXECUTING_UNPARKED`. In that case, instead of transitioning to -`PARKED` when `F.poll()` returns, the future will simply transition -right back to `EXECUTING` and try calling `poll()` again. This can -repeat a few times. - -### Lifetime safety - -Of course, Rayon's signature feature is that it allows you to use a -future `F` that includes references, so long as those references -outlive the lifetime of the scope `'scope`. So why is this safe? - -The basic idea of why this is safe is as follows. The `ScopeFuture` -struct holds a ref on the scope itself (via the field `scope`). -Until this ref is decremented, the scope will not end (and hence -`'scope` is still active). This ref is only decremented while the -future transitions into the *COMPLETE* state -- so anytime before -then, we know we don't have to worry, the references are still valid. - -As we transition into the *COMPLETE* state is where things get more -interesting. You'll notice that signaling the `self.scope` job as done -is the *last* thing that happens during that transition. Importantly, -before that is done, we drop all access that we have to the type `F`: -that is, we store `None` into the fields that might reference values -of type `F`. This implies that we know that, whatever happens after we -transition into *COMPLETE*, we can't access any of the references -found in `F` anymore. - -This is good, because there *are* still active refs to the -`ScopeFuture` after we enter the *COMPLETE* state. There are two -sources of these: unpark values and the future result. - -**NotifyHandle values.** We may have given away `NotifyHandle` values -- -these contain trait objects that are actually refs to our -`ScopeFuture`. Note that `NotifyHandle: 'static`, so these could be -floating about for any length of time (we had to transmute away the -lifetimes to give them out). This is ok because (a) the `Arc` keeps -the `ScopeFuture` alive and (b) the only thing you can do is to call -`notify()`, which will promptly return since the state is *COMPLETE* -(and, anyhow, as we saw above, it doesn't have access to any -references anyhow). - -**Future result.** The other, more interesting reference to the -`ScopeFuture` is the value that we gave back to the user when we -spawned the future in the first place. This value is more interesting -because it can be used to do non-trivial things, unlike the -`NotifyHandle`. If you look carefully at this handle, you will see that -its type has been designed to hide the type `F`. In fact, it only -reveals the types `T` and `E` which are the ok/err result types of the -future `F`. This is intentonal: suppose that the type `F` includes -some references, but those references don't appear in the result. We -want the "result" future to be able to escape the scope, then, to any -place where the types `T` and `E` are still in scope. If we exposed -`F` here that would not be possible. (Hiding `F` also requires a -transmute to an object type, in this case an internal trait called -`ScopeFutureTrait`.) Note though that it is possible for `T` and `E` -to have references in them. They could even be references tied to the -scope. - -So what can a user do with this result future? They have two -operations available: poll and cancel. Let's look at cancel first, -since it's simpler. If the state is *COMPLETE*, then `cancel()` is an -immediate no-op, so we know that it can't be used to access any -references that may be invalid. In any case, the only thing it does is -to set a field to true and invoke `notify()`, and we already examined -the possible effects of `notify()` in the previous section. - -So what about `poll()`? This is how the user gets the final result out -of the future. The important thing that it does is to access (and -effectively nullify) the field `result`, which stores the result of -the future and hence may have access to `T` and `E` values. These -values may contain references...so how do we know that they are still in -scope? The answer is that those types are exposed in the user's type -of the future, and hence the basic Rust type system should guarantee -that any references are still valid, or else the user shouldn't be -able to call `poll()`. (The same is true at the time of cancellation, -but that's not important, since `cancel()` doesn't do anything of -interest.) diff --git a/rayon-futures/src/compile_fail/future_escape.rs b/rayon-futures/src/compile_fail/future_escape.rs deleted file mode 100644 index 6cda4226b..000000000 --- a/rayon-futures/src/compile_fail/future_escape.rs +++ /dev/null @@ -1,46 +0,0 @@ -/*! ```compile_fail,E0382,E0501,E0503,E0716 - -extern crate futures; -extern crate rayon_core; -extern crate rayon_futures; - -use futures::future::lazy; -use rayon_futures::ScopeFutureExt; - -fn a() { - let data = &mut [format!("Hello, ")]; - - let mut future = None; - rayon_core::scope(|s| { - let data = &mut *data; - future = Some(s.spawn_future(lazy(move || Ok::<_, ()>(&mut data[0])))); - }); - - // `data` is still borrowed as part of future here: - assert_eq!(data[0], "Hello, world!"); //~ ERROR -} - -fn b() { - let data = &mut [format!("Hello, ")]; - - let mut future = None; - rayon_core::scope(|s| { - future = Some(s.spawn_future(lazy(move || Ok::<_, ()>(&mut data[0])))); - }); - - // `data` is moved into the scope above, can't use here - assert_eq!(data[0], "Hello, world!"); //~ ERROR -} - -fn c() { - let mut future = None; - // borrowed value does not live long enough - let data = &mut [format!("Hello, ")]; //~ ERROR - rayon_core::scope(|s| { - future = Some(s.spawn_future(lazy(move || Ok::<_, ()>(&mut data[0])))); - }); -} - -fn main() { } - -``` */ diff --git a/rayon-futures/src/compile_fail/mod.rs b/rayon-futures/src/compile_fail/mod.rs deleted file mode 100644 index 9e08a7bd2..000000000 --- a/rayon-futures/src/compile_fail/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -// These modules contain `compile_fail` doc tests. -mod future_escape; diff --git a/rayon-futures/src/lib.rs b/rayon-futures/src/lib.rs deleted file mode 100644 index 1f82cde40..000000000 --- a/rayon-futures/src/lib.rs +++ /dev/null @@ -1,624 +0,0 @@ -//! Future support in Rayon. -//! -//! See `README.md` for details. -#![deny(missing_debug_implementations)] -#![doc(html_root_url = "https://docs.rs/rayon-futures/0.1")] - -use futures::future::CatchUnwind; -use futures::task::{self, Spawn, Task}; -use futures::{Async, Future, Poll}; -use rayon_core::internal::worker; // May need `RUSTFLAGS='--cfg rayon_unstable'` to compile - -use futures::executor::{self, Notify, NotifyHandle, UnsafeNotify}; -use rayon_core::internal::task::{ScopeHandle, Task as RayonTask, ToScopeHandle}; -use std::any::Any; -use std::fmt; -use std::marker::PhantomData; -use std::mem; -use std::panic::{self, AssertUnwindSafe}; -use std::ptr; -use std::sync::atomic::AtomicUsize; -use std::sync::atomic::Ordering::*; -use std::sync::Arc; -use std::sync::Mutex; - -const STATE_PARKED: usize = 0; -const STATE_UNPARKED: usize = 1; -const STATE_EXECUTING: usize = 2; -const STATE_EXECUTING_UNPARKED: usize = 3; -const STATE_COMPLETE: usize = 4; - -pub trait ScopeFutureExt<'scope> { - fn spawn_future(&self, future: F) -> RayonFuture - where - F: Future + Send + 'scope; -} - -impl<'scope, T> ScopeFutureExt<'scope> for T -where - T: ToScopeHandle<'scope>, -{ - fn spawn_future(&self, future: F) -> RayonFuture - where - F: Future + Send + 'scope, - { - let inner = ScopeFuture::spawn(future, self.to_scope_handle()); - - // We assert that it is safe to hide the type `F` (and, in - // particular, the lifetimes in it). This is true because the API - // offered by a `RayonFuture` only permits access to the result of - // the future (of type `F::Item` or `F::Error`) and those types - // *are* exposed in the `RayonFuture` type. See - // README.md for details. - unsafe { - return RayonFuture { - inner: hide_lifetime(inner), - }; - } - - unsafe fn hide_lifetime<'l, T, E>( - x: Arc + 'l>, - ) -> Arc> { - mem::transmute(x) - } - } -} - -/// Represents the result of a future that has been spawned in the -/// Rayon threadpool. -/// -/// # Panic behavior -/// -/// Any panics that occur while computing the spawned future will be -/// propagated when this future is polled. -pub struct RayonFuture { - inner: Arc, Box>>, -} - -impl RayonFuture { - pub fn rayon_wait(mut self) -> Result { - worker::if_in_worker_thread(|worker_thread| { - // In Rayon worker thread: spin. Unsafe because we must be - // sure that `self.inner.probe()` will trigger some Rayon - // event once it becomes true -- and it will, as when the - // future moves to the complete state, we will invoke - // either `ScopeHandle::panicked()` or `ScopeHandle::ok()` - // on our scope handle. - unsafe { - worker_thread.wait_until_true(|| self.inner.probe()); - } - self.poll().map(|a_v| match a_v { - Async::Ready(v) => v, - Async::NotReady => panic!("probe() returned true but poll not ready"), - }) - }) - .unwrap_or_else(|| self.wait()) - } -} - -impl Future for RayonFuture { - type Item = T; - type Error = E; - - fn wait(self) -> Result { - worker::if_in_worker_thread(|_| { - panic!("using `wait()` in a Rayon thread is unwise; try `rayon_wait()`") - }); - executor::spawn(self).wait_future() - } - - fn poll(&mut self) -> Poll { - match self.inner.poll() { - Ok(Async::Ready(Ok(v))) => Ok(Async::Ready(v)), - Ok(Async::Ready(Err(e))) => Err(e), - Ok(Async::NotReady) => Ok(Async::NotReady), - Err(e) => panic::resume_unwind(e), - } - } -} - -impl Drop for RayonFuture { - fn drop(&mut self) { - self.inner.cancel(); - } -} - -impl fmt::Debug for RayonFuture { - fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt.debug_struct("RayonFuture").finish() - } -} -/// //////////////////////////////////////////////////////////////////////// -#[derive(Debug)] -struct ScopeFuture<'scope, F, S> -where - F: Future + Send + 'scope, - S: ScopeHandle<'scope>, -{ - state: AtomicUsize, - contents: Mutex>, -} - -type CU = CatchUnwind>; -type CUItem = as Future>::Item; -type CUError = as Future>::Error; - -struct ScopeFutureContents<'scope, F, S> -where - F: Future + Send, - S: ScopeHandle<'scope>, -{ - spawn: Option>>, - - // Pointer to ourselves. We `None` this out when we are finished - // executing, but it's convenient to keep around normally. - this: Option>, - - // the counter in the scope; since the scope doesn't terminate until - // counter reaches zero, and we hold a ref in this counter, we are - // assured that this pointer remains valid - scope: Option, - - waiting_task: Option, - result: Poll, CUError>, - - canceled: bool, -} - -impl<'scope, F, S> fmt::Debug for ScopeFutureContents<'scope, F, S> -where - F: Future + Send + 'scope, - S: ScopeHandle<'scope>, -{ - fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt.debug_struct("ScopeFutureContents").finish() - } -} - -// Newtype so we can implement Into even though the contents are not 'static. -#[derive(Debug)] -struct ArcScopeFuture<'scope, F, S>(Arc>) -where - F: Future + Send, - S: ScopeHandle<'scope>; - -impl<'scope, F, S> Clone for ArcScopeFuture<'scope, F, S> -where - F: Future + Send + 'scope, - S: ScopeHandle<'scope>, -{ - fn clone(&self) -> Self { - ArcScopeFuture(self.0.clone()) - } -} - -impl<'scope, F, S> Notify for ArcScopeFuture<'scope, F, S> -where - F: Future + Send + 'scope, - S: ScopeHandle<'scope>, -{ - fn notify(&self, id: usize) { - self.0.notify(id) - } - - fn clone_id(&self, id: usize) -> usize { - self.0.clone_id(id) - } - - fn drop_id(&self, id: usize) { - self.0.drop_id(id) - } -} - -// This is adapted from the implementation of Into for -// Arc in futures-rs, we need to roll our own to drop the 'static bound. -// A ScopeFuture that is inside a ArcScopeFuture. -#[derive(Debug)] -struct ScopeFutureWrapped<'scope, F, S>(PhantomData<(&'scope F, S)>); - -unsafe impl<'scope, F, S> Send for ScopeFutureWrapped<'scope, F, S> {} -unsafe impl<'scope, F, S> Sync for ScopeFutureWrapped<'scope, F, S> {} - -impl<'scope, F, S> Notify for ScopeFutureWrapped<'scope, F, S> -where - F: Future + Send + 'scope, - S: ScopeHandle<'scope>, -{ - fn notify(&self, id: usize) { - unsafe { - let me: *const ScopeFutureWrapped<'scope, F, S> = self; - ArcScopeFuture::notify( - &*(&me as *const *const ScopeFutureWrapped<'scope, F, S> - as *const ArcScopeFuture<'scope, F, S>), - id, - ) - } - } - - fn clone_id(&self, id: usize) -> usize { - unsafe { - let me: *const ScopeFutureWrapped<'scope, F, S> = self; - ArcScopeFuture::clone_id( - &*(&me as *const *const ScopeFutureWrapped<'scope, F, S> - as *const ArcScopeFuture<'scope, F, S>), - id, - ) - } - } - - fn drop_id(&self, id: usize) { - unsafe { - let me: *const ScopeFutureWrapped<'scope, F, S> = self; - ArcScopeFuture::drop_id( - &*(&me as *const *const ScopeFutureWrapped<'scope, F, S> - as *const ArcScopeFuture<'scope, F, S>), - id, - ) - } - } -} - -unsafe impl<'scope, F, S> UnsafeNotify for ScopeFutureWrapped<'scope, F, S> -where - F: Future + Send + 'scope, - S: ScopeHandle<'scope>, -{ - unsafe fn clone_raw(&self) -> NotifyHandle { - let me: *const ScopeFutureWrapped<'scope, F, S> = self; - let arc = (*(&me as *const *const ScopeFutureWrapped<'scope, F, S> - as *const ArcScopeFuture<'scope, F, S>)) - .clone(); - NotifyHandle::from(arc) - } - - unsafe fn drop_raw(&self) { - let mut me: *const ScopeFutureWrapped<'scope, F, S> = self; - let me = &mut me as *mut *const ScopeFutureWrapped<'scope, F, S> - as *mut ArcScopeFuture<'scope, F, S>; - ptr::drop_in_place(me); - } -} - -impl<'scope, F, S> From> for NotifyHandle -where - F: Future + Send + 'scope, - S: ScopeHandle<'scope>, -{ - fn from(rc: ArcScopeFuture<'scope, F, S>) -> NotifyHandle { - unsafe { - let ptr = mem::transmute::< - ArcScopeFuture<'scope, F, S>, - *mut ScopeFutureWrapped<'scope, F, S>, - >(rc); - // Hide any lifetimes in `self`. This is safe because, until - // `self` is dropped, the counter is not decremented, and so - // the `'scope` lifetimes cannot end. - // - // Here we assert that hiding the lifetimes in this fashion is - // safe: we claim this is true because the lifetimes we are - // hiding are part of `F`, and we now that any lifetimes in - // `F` outlive `counter`. And we can see from `complete()` - // that we drop all values of type `F` before decrementing - // `counter`. - NotifyHandle::new(mem::transmute(ptr as *mut dyn UnsafeNotify)) - } - } -} - -// Assert that the `*const` is safe to transmit between threads: -unsafe impl<'scope, F, S> Send for ScopeFuture<'scope, F, S> -where - F: Future + Send + 'scope, - S: ScopeHandle<'scope>, -{ -} -unsafe impl<'scope, F, S> Sync for ScopeFuture<'scope, F, S> -where - F: Future + Send + 'scope, - S: ScopeHandle<'scope>, -{ -} - -impl<'scope, F, S> ScopeFuture<'scope, F, S> -where - F: Future + Send + 'scope, - S: ScopeHandle<'scope>, -{ - fn spawn(future: F, scope: S) -> Arc { - // Using `AssertUnwindSafe` is valid here because (a) the data - // is `Send + Sync`, which is our usual boundary and (b) - // panics will be propagated when the `RayonFuture` is polled. - let spawn = task::spawn(AssertUnwindSafe(future).catch_unwind()); - - let future: Arc = Arc::new(ScopeFuture:: { - state: AtomicUsize::new(STATE_PARKED), - contents: Mutex::new(ScopeFutureContents { - spawn: None, - this: None, - scope: Some(scope), - waiting_task: None, - result: Ok(Async::NotReady), - canceled: false, - }), - }); - - // Make the two self-cycles. Note that these imply the future - // cannot be freed until these fields are set to `None` (which - // occurs when it is finished executing). - { - let mut contents = future.contents.try_lock().unwrap(); - contents.spawn = Some(spawn); - contents.this = Some(ArcScopeFuture(future.clone())); - } - - future.notify(0); - - future - } - - fn unpark_inherent(&self) { - loop { - match self.state.load(Relaxed) { - STATE_PARKED => { - if { - self.state - .compare_exchange_weak(STATE_PARKED, STATE_UNPARKED, Release, Relaxed) - .is_ok() - } { - // Contention here is unlikely but possible: a - // previous execution might have moved us to the - // PARKED state but not yet released the lock. - let contents = self.contents.lock().unwrap(); - let task_ref = contents.this.clone().expect("this ref already dropped"); - - // We assert that `contents.scope` will be not - // be dropped until the task is executed. This - // is true because we only drop - // `contents.scope` from within `RayonTask::execute()`. - unsafe { - contents - .scope - .as_ref() - .expect("scope already dropped") - .spawn_task(task_ref.0); - } - return; - } - } - - STATE_EXECUTING => { - if { - self.state - .compare_exchange_weak( - STATE_EXECUTING, - STATE_EXECUTING_UNPARKED, - Release, - Relaxed, - ) - .is_ok() - } { - return; - } - } - - state => { - debug_assert!( - state == STATE_UNPARKED - || state == STATE_EXECUTING_UNPARKED - || state == STATE_COMPLETE - ); - return; - } - } - } - } - - fn begin_execute_state(&self) { - // When we are put into the unparked state, we are enqueued in - // a worker thread. We should then be executed exactly once, - // at which point we transiition to STATE_EXECUTING. Nobody - // should be contending with us to change the state here. - let state = self.state.load(Acquire); - debug_assert_eq!(state, STATE_UNPARKED); - let result = self - .state - .compare_exchange(state, STATE_EXECUTING, Release, Relaxed); - debug_assert_eq!(result, Ok(STATE_UNPARKED)); - } - - fn end_execute_state(&self) -> bool { - loop { - match self.state.load(Relaxed) { - STATE_EXECUTING => { - if { - self.state - .compare_exchange_weak(STATE_EXECUTING, STATE_PARKED, Release, Relaxed) - .is_ok() - } { - // We put ourselves into parked state, no need to - // re-execute. We'll just wait for the Notify. - return true; - } - } - - state => { - debug_assert_eq!(state, STATE_EXECUTING_UNPARKED); - if { - self.state - .compare_exchange_weak(state, STATE_EXECUTING, Release, Relaxed) - .is_ok() - } { - // We finished executing, but an unpark request - // came in the meantime. We need to execute - // again. Return false as we failed to end the - // execution phase. - return false; - } - } - } - } - } -} - -impl<'scope, F, S> Notify for ScopeFuture<'scope, F, S> -where - F: Future + Send + 'scope, - S: ScopeHandle<'scope>, -{ - fn notify(&self, _: usize) { - self.unpark_inherent(); - } -} - -impl<'scope, F, S> RayonTask for ScopeFuture<'scope, F, S> -where - F: Future + Send + 'scope, - S: ScopeHandle<'scope>, -{ - fn execute(this: Arc) { - // *generally speaking* there should be no contention for the - // lock, but it is possible -- we can end execution, get re-enqeueud, - // and re-executed, before we have time to return from this fn - let mut contents = this.contents.lock().unwrap(); - - this.begin_execute_state(); - loop { - if contents.canceled { - return contents.complete(Ok(Async::NotReady)); - } else { - match contents.poll() { - Ok(Async::Ready(v)) => { - return contents.complete(Ok(Async::Ready(v))); - } - Ok(Async::NotReady) => { - if this.end_execute_state() { - return; - } - } - Err(err) => { - return contents.complete(Err(err)); - } - } - } - } - } -} - -impl<'scope, F, S> ScopeFutureContents<'scope, F, S> -where - F: Future + Send + 'scope, - S: ScopeHandle<'scope>, -{ - fn poll(&mut self) -> Poll, CUError> { - let notify = self.this.as_ref().unwrap(); - self.spawn.as_mut().unwrap().poll_future_notify(notify, 0) - } - - fn complete(&mut self, value: Poll, CUError>) { - // So, this is subtle. We know that the type `F` may have some - // data which is only valid until the end of the scope, and we - // also know that the scope doesn't end until `self.counter` - // is decremented below. So we want to be sure to drop - // `self.future` first, lest its dtor try to access some of - // that state or something! - mem::drop(self.spawn.take().unwrap()); - - self.result = value; - let this = self.this.take().unwrap(); - if cfg!(debug_assertions) { - let state = this.0.state.load(Relaxed); - debug_assert!( - state == STATE_EXECUTING || state == STATE_EXECUTING_UNPARKED, - "cannot complete when not executing (state = {})", - state - ); - } - this.0.state.store(STATE_COMPLETE, Release); - - // `notify()` here is arbitrary user-code, so it may well - // panic. We try to capture that panic and forward it - // somewhere useful if we can. - let mut err = None; - if let Some(waiting_task) = self.waiting_task.take() { - match panic::catch_unwind(AssertUnwindSafe(|| waiting_task.notify())) { - Ok(()) => {} - Err(e) => { - err = Some(e); - } - } - } - - // Allow the enclosing scope to end. Asserts that - // `self.counter` is still valid, which we know because caller - // to `new_rayon_future()` ensures it for us. - let scope = self.scope.take().unwrap(); - if let Some(err) = err { - scope.panicked(err); - } else { - scope.ok(); - } - } -} - -trait ScopeFutureTrait: Send + Sync { - /// Returns true when future is in the COMPLETE state. - fn probe(&self) -> bool; - - /// Execute the `poll` operation of a future: read the result if - /// it is ready, return `Async::NotReady` otherwise. - fn poll(&self) -> Poll; - - /// Indicate that we no longer care about the result of the future. - /// Corresponds to `Drop` in the future trait. - fn cancel(&self); -} - -impl<'scope, F, S> ScopeFutureTrait, CUError> for ScopeFuture<'scope, F, S> -where - F: Future + Send + 'scope, - S: ScopeHandle<'scope>, -{ - fn probe(&self) -> bool { - self.state.load(Acquire) == STATE_COMPLETE - } - - fn poll(&self) -> Poll, CUError> { - // Important: due to transmute hackery, not all the fields are - // truly known to be valid at this point. In particular, the - // type F is erased. But the `state` and `result` fields - // should be valid. - let mut contents = self.contents.lock().unwrap(); - let state = self.state.load(Relaxed); - if state == STATE_COMPLETE { - let r = mem::replace(&mut contents.result, Ok(Async::NotReady)); - return r; - } else { - contents.waiting_task = Some(task::current()); - Ok(Async::NotReady) - } - } - - fn cancel(&self) { - // Fast-path: check if this is already complete and return if - // so. A relaxed load suffices since we are not going to - // access any data as a result of this action. - if self.state.load(Relaxed) == STATE_COMPLETE { - return; - } - - // Slow-path. Get the lock and set the canceled flag to - // true. Also grab the `this` instance (which may be `None`, - // if the future completes before we get the lack). - let mut contents = self.contents.lock().unwrap(); - contents.canceled = true; - - // If the `this` we grabbed was not `None`, then notify it. - // This will schedule the future. - if let Some(ref u) = contents.this { - u.notify(0); - } - } -} - -mod compile_fail; -mod test; diff --git a/rayon-futures/src/test.rs b/rayon-futures/src/test.rs deleted file mode 100644 index 32a0011e9..000000000 --- a/rayon-futures/src/test.rs +++ /dev/null @@ -1,288 +0,0 @@ -#![cfg(test)] - -use super::ScopeFutureExt; -use futures::executor::Notify; -use futures::future::lazy; -use futures::sync::oneshot; -use futures::task; -use futures::{self, Async, Future}; -use rayon_core::{scope, ThreadPool, ThreadPoolBuilder}; -use std::sync::atomic::{AtomicUsize, Ordering}; -use std::sync::{Arc, Mutex}; - -/// Basic test of using futures to data on the stack frame. -#[test] -fn future_test() { - let data = &[0, 1]; - - // Here we call `wait` on a select future, which will block at - // least one thread. So we need a second thread to ensure no - // deadlock. - ThreadPoolBuilder::new() - .num_threads(2) - .build() - .unwrap() - .install(|| { - scope(|s| { - let a = s.spawn_future(futures::future::ok::<_, ()>(&data[0])); - let b = s.spawn_future(futures::future::ok::<_, ()>(&data[1])); - let (item1, next) = a.select(b).wait().ok().unwrap(); - let item2 = next.wait().unwrap(); - assert!(*item1 == 0 || *item1 == 1); - assert!(*item2 == 1 - *item1); - }); - }); -} - -/// Test using `map` on a Rayon future. The `map` closure is eecuted -/// for side-effects, and modifies the `data` variable that is owned -/// by enclosing stack frame. -#[test] -fn future_map() { - let data = &mut [format!("Hello, ")]; - - let mut future = None; - scope(|s| { - let a = s.spawn_future(lazy(|| Ok::<_, ()>(&mut data[0]))); - future = Some(s.spawn_future(a.map(|v| { - v.push_str("world!"); - }))); - }); - - // future must have executed for the scope to have ended, even - // though we never invoked `wait` to observe its result - assert_eq!(data[0], "Hello, world!"); - assert!(future.is_some()); -} - -/// Test that we can create a future that returns an `&mut` to data, -/// so long as it outlives the scope. -#[test] -fn future_escape_ref() { - let data = &mut [format!("Hello, ")]; - - { - let mut future = None; - scope(|s| { - let data = &mut *data; - future = Some(s.spawn_future(lazy(move || Ok::<_, ()>(&mut data[0])))); - }); - let s = future.unwrap().wait().unwrap(); - s.push_str("world!"); - } - - assert_eq!(data[0], "Hello, world!"); -} - -#[test] -#[should_panic(expected = "Hello, world!")] -fn future_panic_prop() { - scope(|s| { - let future = s.spawn_future(lazy(move || Ok::<(), ()>(argh()))); - let _ = future.rayon_wait(); // should panic, not return a value - }); - - fn argh() -> () { - if true { - panic!("Hello, world!"); - } - } -} - -/// Test that, even if we have only one thread, invoke `rayon_wait` -/// will not panic. -#[test] -fn future_rayon_wait_1_thread() { - // run with only 1 worker thread; this would deadlock if we couldn't make progress - let mut result = None; - ThreadPoolBuilder::new() - .num_threads(1) - .build() - .unwrap() - .install(|| { - scope(|s| { - use std::sync::mpsc::channel; - let (tx, rx) = channel(); - let a = s.spawn_future(lazy(move || Ok::(rx.recv().unwrap()))); - // ^^^^ FIXME: why is this needed? - let b = s.spawn_future(a.map(|v| v + 1)); - let c = s.spawn_future(b.map(|v| v + 1)); - s.spawn(move |_| tx.send(20).unwrap()); - result = Some(c.rayon_wait().unwrap()); - }); - }); - assert_eq!(result, Some(22)); -} - -/// Test that invoking `wait` on a `RayonFuture` will panic, if it is inside -/// a Rayon worker thread. -#[test] -#[should_panic] -fn future_wait_panics_inside_rayon_thread() { - scope(|s| { - let future = s.spawn_future(lazy(move || Ok::<(), ()>(()))); - let _ = future.wait(); // should panic, not return a value - }); -} - -/// Test that invoking `wait` on a `RayonFuture` will not panic if we -/// are outside a Rayon worker thread. -#[test] -fn future_wait_works_outside_rayon_threads() { - let mut future = None; - scope(|s| { - future = Some(s.spawn_future(lazy(move || Ok::<(), ()>(())))); - }); - assert_eq!(Ok(()), future.unwrap().wait()); -} - -/// Test that invoking `wait` on a `RayonFuture` will not panic if we -/// are outside a Rayon worker thread. -#[test] -#[should_panic(expected = "Hello, world!")] -fn panicy_unpark() { - scope(|s| { - let (a_tx, a_rx) = oneshot::channel::(); - let rf = s.spawn_future(a_rx); - - // invoke `poll_future` with a `PanicUnpark` instance; - // this should get installed as a 'waiting task' on the - // Rayon future `rf` - let mut spawn = task::spawn(rf); - match spawn.poll_future_notify(&PANIC_UNPARK, 0) { - Ok(Async::NotReady) => { - // good, we expect not to be ready yet - } - r => panic!("spawn poll returned: {:?}", r), - } - - // this should trigger the future `a_rx` to be awoken - // and executing in a Rayon background thread - a_tx.send(22).unwrap(); - - // now we wait for `rf` to complete; when it does, it will - // also signal the `PanicUnpark` to wake up (that is - // *supposed* to be what triggers us to `poll` again, but - // we are sidestepping that) - let v = spawn.into_inner().rayon_wait().unwrap(); - assert_eq!(v, 22); - }); - panic!("scope failed to panic!"); - - #[derive(Clone)] - struct PanicUnpark; - - impl Notify for PanicUnpark { - fn notify(&self, _: usize) { - panic!("Hello, world!"); - } - } - - const PANIC_UNPARK: &'static PanicUnpark = &PanicUnpark; -} - -#[test] -fn double_unpark() { - let unpark0 = Arc::new(TrackUnpark { - value: AtomicUsize::new(0), - }); - let unpark1 = Arc::new(TrackUnpark { - value: AtomicUsize::new(0), - }); - let mut _tag = None; - scope(|s| { - let (a_tx, a_rx) = oneshot::channel::(); - let rf = s.spawn_future(a_rx); - - let mut spawn = task::spawn(rf); - - // test that we don't panic if people try to install a task many times; - // even if they are different tasks - for i in 0..22 { - let u = if i % 2 == 0 { - unpark0.clone() - } else { - unpark1.clone() - }; - match spawn.poll_future_notify(&u, 0) { - Ok(Async::NotReady) => { - // good, we expect not to be ready yet - } - r => panic!("spawn poll returned: {:?}", r), - } - } - - a_tx.send(22).unwrap(); - - // just hold onto `rf` to ensure that nothing is cancelled - _tag = Some(spawn.into_inner()); - }); - - // Since scope is done, our spawned future must have completed. It - // should have signalled the unpark value we gave it -- but - // exactly once, even though we called `poll` many times. - assert_eq!(unpark1.value.load(Ordering::SeqCst), 1); - - // unpark0 was not the last unpark supplied, so it will never be signalled - assert_eq!(unpark0.value.load(Ordering::SeqCst), 0); - - struct TrackUnpark { - value: AtomicUsize, - } - - impl Notify for TrackUnpark { - fn notify(&self, _: usize) { - self.value.fetch_add(1, Ordering::SeqCst); - } - } -} - -#[test] -fn async_future_map() { - let data = Arc::new(Mutex::new(format!("Hello, "))); - - let pool = ThreadPool::global(); - let a = pool.spawn_future(lazy({ - let data = data.clone(); - move || Ok::<_, ()>(data) - })); - let future = pool.spawn_future(a.map(|data| { - let mut v = data.lock().unwrap(); - v.push_str("world!"); - })); - let () = future.wait().unwrap(); - - // future must have executed for the scope to have ended, even - // though we never invoked `wait` to observe its result - assert_eq!(&data.lock().unwrap()[..], "Hello, world!"); -} - -#[test] -#[should_panic(expected = "Hello, world!")] -fn async_future_panic_prop() { - let pool = ThreadPool::global(); - let future = pool.spawn_future(lazy(move || Ok::<(), ()>(argh()))); - let _ = future.rayon_wait(); // should panic, not return a value - - fn argh() -> () { - if true { - panic!("Hello, world!"); - } - } -} - -#[test] -fn async_future_scope_interact() { - let pool = ThreadPool::global(); - let future = pool.spawn_future(lazy(move || Ok::(22))); - - let mut vec = vec![]; - scope(|s| { - let future = s.spawn_future(future.map(|x| x * 2)); - s.spawn(|_| { - vec.push(future.rayon_wait().unwrap()); - }); // just because - }); - - assert_eq!(vec![44], vec); -} diff --git a/rayon-futures/tests/compile-fail/README.md b/rayon-futures/tests/compile-fail/README.md deleted file mode 100644 index 58a148514..000000000 --- a/rayon-futures/tests/compile-fail/README.md +++ /dev/null @@ -1,11 +0,0 @@ -This directory contains test files that are **not expected to -compile**. It is useful for writing tests that things which ought not -to type-check do not, in fact, type-check. - -To write a test, just write a `.rs` file using Rayon. Then, for each -compilation error, write a `//~ ERROR E123` annotation on the line -where the error occurs. `E123` should be the error code that is issued -by rustc. This should be reasonably robust against future compiler -changes, though in some cases the errors may start showing up on -different lines etc as compiler heuristics change. - From 1f9d117d51782b338910c26357b697beca2eca47 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 19 Dec 2019 10:48:00 -0800 Subject: [PATCH 2/9] Remove cfg(rayon_unstable) --- .travis.yml | 24 +------- appveyor.yml | 7 --- rayon-core/src/internal/mod.rs | 8 --- rayon-core/src/internal/task.rs | 83 -------------------------- rayon-core/src/internal/worker.rs | 67 --------------------- rayon-core/src/lib.rs | 5 +- rayon-core/src/registry.rs | 56 ----------------- rayon-core/src/scope/internal.rs | 61 ------------------- rayon-core/src/scope/mod.rs | 1 - rayon-core/src/thread_pool/internal.rs | 65 -------------------- rayon-core/src/thread_pool/mod.rs | 22 ------- 11 files changed, 3 insertions(+), 396 deletions(-) delete mode 100644 rayon-core/src/internal/mod.rs delete mode 100644 rayon-core/src/internal/task.rs delete mode 100644 rayon-core/src/internal/worker.rs delete mode 100644 rayon-core/src/scope/internal.rs delete mode 100644 rayon-core/src/thread_pool/internal.rs diff --git a/.travis.yml b/.travis.yml index 28bb4b0f2..51c400cd5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,8 @@ matrix: fast_finish: true include: # NB: To help with CI delays, each `pull_request` is only tested on Linux, - # with 1.31 for compatibility and stable+rayon_unstable for broad test - # coverage. The bors bot counts as a `push` type, which will run it all. + # with 1.31 for compatibility and stable for broad test coverage. The bors + # bot counts as a `push` type, which will run it all. - rust: 1.31.0 os: linux @@ -20,43 +20,23 @@ matrix: - rust: stable os: linux - if: NOT type = pull_request - - rust: stable - os: linux - env: RUSTFLAGS='--cfg rayon_unstable' #if: everything! - rust: beta os: linux if: NOT type = pull_request - - rust: beta - os: linux - env: RUSTFLAGS='--cfg rayon_unstable' - if: NOT type = pull_request - rust: nightly os: linux if: NOT type = pull_request - - rust: nightly - os: linux - env: RUSTFLAGS='--cfg rayon_unstable' - if: NOT type = pull_request - rust: stable os: osx if: NOT type = pull_request - - rust: stable - os: osx - env: RUSTFLAGS='--cfg rayon_unstable' - if: NOT type = pull_request - rust: nightly os: osx if: NOT type = pull_request - - rust: nightly - os: osx - env: RUSTFLAGS='--cfg rayon_unstable' - if: NOT type = pull_request # wasm won't actually work without threading, but it builds - rust: nightly diff --git a/appveyor.yml b/appveyor.yml index f3bf4ec96..dbb56801e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,15 +3,8 @@ environment: matrix: - TARGET: x86_64-pc-windows-gnu CHANNEL: stable - - TARGET: x86_64-pc-windows-gnu - CHANNEL: stable - RUSTFLAGS: --cfg rayon_unstable - - - TARGET: x86_64-pc-windows-msvc - CHANNEL: stable - TARGET: x86_64-pc-windows-msvc CHANNEL: stable - RUSTFLAGS: --cfg rayon_unstable install: - curl -sSf -o rustup-init.exe https://win.rustup.rs diff --git a/rayon-core/src/internal/mod.rs b/rayon-core/src/internal/mod.rs deleted file mode 100644 index f9f2b8fc8..000000000 --- a/rayon-core/src/internal/mod.rs +++ /dev/null @@ -1,8 +0,0 @@ -//! The internal directory contains internal APIs not meant to be -//! exposed to "end-users" of Rayon, but rather which are useful for -//! constructing abstractions. -//! -//! These APIs are still unstable. - -pub mod task; -pub mod worker; diff --git a/rayon-core/src/internal/task.rs b/rayon-core/src/internal/task.rs deleted file mode 100644 index 573ed3263..000000000 --- a/rayon-core/src/internal/task.rs +++ /dev/null @@ -1,83 +0,0 @@ -//! Internal, unsafe APIs for creating scoped tasks. Intended for -//! building abstractions atop the rayon-core thread pool, rather than -//! direct use by end users. These APIs are mostly analogous to the -//! (safe) `scope`/`spawn` APIs, but with some unsafe requirements -//! that permit greater efficiency. - -use std::any::Any; -use std::sync::Arc; - -/// Represents a task that can be scheduled onto the Rayon -/// thread-pool. Once a task is scheduler, it will execute exactly -/// once (eventually). -pub trait Task: Send + Sync { - /// Invoked by the thread-pool when the task is ready to execute. - fn execute(this: Arc); -} - -/// Represents a handle onto some Rayon scope. This could be either a -/// local scope created by the `scope()` function or the global scope -/// for a thread-pool. To get a scope-handle, you can invoke -/// `ToScopeHandle::to_scope_handle()` on either a `scope` value or a -/// `ThreadPool`. -/// -/// The existence of `ScopeHandler` offers a guarantee: -/// -/// - The Rust lifetime `'scope` will not end until the scope-handle -/// is dropped, or until you invoke `panicked()` or `ok()`. -/// -/// This trait is intended to be used as follows: -/// -/// - You have a parallel task of type `T` to perform where `T: 's`, -/// meaning that any references that `T` contains outlive the lifetime -/// `'s`. -/// - You obtain a scope handle `h` of type `H` where `H: -/// ScopeHandle<'s>`; typically this would be by invoking -/// `to_scope_handle()` on a Rayon scope (of type `Scope<'s>`) or a -/// thread-pool (in which case `'s == 'static`). -/// - You invoke `h.spawn()` to start your job(s). This may be done -/// many times. -/// - Note that `h.spawn()` is an unsafe method. You must ensure -/// that your parallel jobs have completed before moving to -/// the next step. -/// - Eventually, when all invocations are complete, you invoke -/// either `panicked()` or `ok()`. -pub unsafe trait ScopeHandle<'scope>: 'scope { - /// Enqueues a task for execution within the thread-pool. The task - /// will eventually be invoked, and once it is, the `Arc` will be - /// dropped. - /// - /// **Unsafe:** The caller must guarantee that the scope handle - /// (`self`) will not be dropped (nor will `ok()` or `panicked()` - /// be called) until the task executes. Otherwise, the lifetime - /// `'scope` may end while the task is still pending. - unsafe fn spawn_task(&self, task: Arc); - - /// Indicates that some sub-task of this scope panicked with the - /// given `err`. This panic will be propagated back to the user as - /// appropriate, depending on how this scope handle was derived. - /// - /// This takes ownership of the scope handle, meaning that once - /// you invoke `panicked`, the scope is permitted to terminate - /// (and, in particular, the Rust lifetime `'scope` may end). - fn panicked(self, err: Box); - - /// Indicates that the sub-tasks of this scope that you have - /// spawned concluded successfully. - /// - /// This takes ownership of the scope handle, meaning that once - /// you invoke `panicked`, the scope is permitted to terminate - /// (and, in particular, the Rust lifetime `'scope` may end). - fn ok(self); -} - -/// Converts a Rayon structure (typically a `Scope` or `ThreadPool`) -/// into a "scope handle". See the `ScopeHandle` trait for more -/// details. -pub trait ToScopeHandle<'scope> { - /// Scope handle type that gets produced. - type ScopeHandle: ScopeHandle<'scope>; - - /// Convert the receiver into a scope handle. - fn to_scope_handle(&self) -> Self::ScopeHandle; -} diff --git a/rayon-core/src/internal/worker.rs b/rayon-core/src/internal/worker.rs deleted file mode 100644 index 1b2a596bf..000000000 --- a/rayon-core/src/internal/worker.rs +++ /dev/null @@ -1,67 +0,0 @@ -//! Internal, unsafe APIs for manipulating or querying the current -//! worker thread. Intended for building abstractions atop the -//! rayon-core thread pool, rather than direct use by end users. - -use crate::latch::LatchProbe; -use crate::registry; -use std::fmt; - -/// Represents the active worker thread. -pub struct WorkerThread<'w> { - thread: &'w registry::WorkerThread, -} - -impl<'w> WorkerThread<'w> { - /// Causes the worker thread to wait until `f()` returns true. - /// While the thread is waiting, it will attempt to steal work - /// from other threads, and may go to sleep if there is no work to - /// steal. - /// - /// **Dead-lock warning: This is a low-level interface and cannot - /// be used to wait on arbitrary conditions.** In particular, if - /// the Rayon thread goes to sleep, it will only be awoken when - /// new rayon events occur (e.g., `spawn()` or `join()` is - /// invoked, or one of the methods on a `ScopeHandle`). Therefore, - /// you must ensure that, once the condition `f()` becomes true, - /// some "rayon event" will also occur to ensure that waiting - /// threads are awoken. - pub unsafe fn wait_until_true(&self, f: F) - where - F: Fn() -> bool, - { - struct DummyLatch<'a, F> { - f: &'a F, - } - - impl<'a, F: Fn() -> bool> LatchProbe for DummyLatch<'a, F> { - fn probe(&self) -> bool { - (self.f)() - } - } - - self.thread.wait_until(&DummyLatch { f: &f }); - } -} - -impl<'w> fmt::Debug for WorkerThread<'w> { - fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt.debug_struct("WorkerThread") - .field("pool", &self.thread.registry().id()) - .field("index", &self.thread.index()) - .finish() - } -} - -/// If the current thread is a Rayon worker thread, then the callback -/// is invoked with a reference to the worker-thread the result of -/// that callback is returned with `Some`. Otherwise, if we are not on -/// a Rayon worker thread, `None` is immediately returned. -pub fn if_in_worker_thread(if_true: F) -> Option -where - F: FnOnce(&WorkerThread<'_>) -> R, -{ - unsafe { - let thread = registry::WorkerThread::current().as_ref()?; - Some(if_true(&WorkerThread { thread })) - } -} diff --git a/rayon-core/src/lib.rs b/rayon-core/src/lib.rs index 94288726a..5365fe284 100644 --- a/rayon-core/src/lib.rs +++ b/rayon-core/src/lib.rs @@ -32,7 +32,7 @@ use std::io; use std::marker::PhantomData; use std::str::FromStr; -#[cfg(any(debug_assertions, rayon_unstable))] +#[cfg(any(debug_assertions))] #[macro_use] extern crate lazy_static; @@ -55,9 +55,6 @@ mod util; mod compile_fail; mod test; -#[cfg(rayon_unstable)] -pub mod internal; - pub use self::join::{join, join_context}; pub use self::registry::ThreadBuilder; pub use self::scope::{scope, Scope}; diff --git a/rayon-core/src/registry.rs b/rayon-core/src/registry.rs index 65dbed04f..ab6cbceee 100644 --- a/rayon-core/src/registry.rs +++ b/rayon-core/src/registry.rs @@ -1,9 +1,5 @@ use crossbeam_deque::{Steal, Stealer, Worker}; use crossbeam_queue::SegQueue; -#[cfg(rayon_unstable)] -use crate::internal::task::Task; -#[cfg(rayon_unstable)] -use crate::job::Job; use crate::job::{JobFifo, JobRef, StackJob}; use crate::latch::{CountLatch, Latch, LatchProbe, LockLatch, SpinLatch, TickleLatch}; use crate::log::Event::*; @@ -267,11 +263,6 @@ impl Registry { Ok(registry.clone()) } - #[cfg(rayon_unstable)] - pub(super) fn global() -> Arc { - global_registry().clone() - } - pub(super) fn current() -> Arc { unsafe { let worker_thread = WorkerThread::current(); @@ -377,53 +368,6 @@ impl Registry { } } - /// Unsafe: the caller must guarantee that `task` will stay valid - /// until it executes. - #[cfg(rayon_unstable)] - pub(super) unsafe fn submit_task(&self, task: Arc) - where - T: Task, - { - let task_job = TaskJob::new(task); - let task_job_ref = TaskJob::into_job_ref(task_job); - return self.inject_or_push(task_job_ref); - - /// A little newtype wrapper for `T`, just because I did not - /// want to implement `Job` for all `T: Task`. - struct TaskJob { - _data: T, - } - - impl TaskJob { - fn new(arc: Arc) -> Arc { - // `TaskJob` has the same layout as `T`, so we can safely - // tranmsute this `T` into a `TaskJob`. This lets us write our - // impls of `Job` for `TaskJob`, making them more restricted. - // Since `Job` is a private trait, this is not strictly necessary, - // I don't think, but makes me feel better. - unsafe { mem::transmute(arc) } - } - - fn into_task(this: Arc>) -> Arc { - // Same logic as `new()` - unsafe { mem::transmute(this) } - } - - unsafe fn into_job_ref(this: Arc) -> JobRef { - let this: *const Self = mem::transmute(this); - JobRef::new(this) - } - } - - impl Job for TaskJob { - unsafe fn execute(this: *const Self) { - let this: Arc = mem::transmute(this); - let task: Arc = TaskJob::into_task(this); - Task::execute(task); - } - } - } - /// Push a job into the "external jobs" queue; it will be taken by /// whatever worker has nothing to do. Use this is you know that /// you are not on a worker of this registry. diff --git a/rayon-core/src/scope/internal.rs b/rayon-core/src/scope/internal.rs deleted file mode 100644 index 03c53f368..000000000 --- a/rayon-core/src/scope/internal.rs +++ /dev/null @@ -1,61 +0,0 @@ -#![cfg(rayon_unstable)] - -use super::{Scope, ScopeBase}; -use crate::internal::task::{ScopeHandle, Task, ToScopeHandle}; -use std::any::Any; -use std::mem; -use std::sync::Arc; - -impl<'scope> ToScopeHandle<'scope> for Scope<'scope> { - type ScopeHandle = LocalScopeHandle<'scope>; - - fn to_scope_handle(&self) -> Self::ScopeHandle { - unsafe { LocalScopeHandle::new(self) } - } -} - -#[derive(Debug)] -pub struct LocalScopeHandle<'scope> { - scope: *const ScopeBase<'scope>, -} - -impl<'scope> LocalScopeHandle<'scope> { - /// Caller guarantees that `*scope` will remain valid - /// until the scope completes. Since we acquire a ref, - /// that means it will remain valid until we release it. - unsafe fn new(scope: &Scope<'scope>) -> Self { - scope.base.increment(); - LocalScopeHandle { scope: &scope.base } - } -} - -impl<'scope> Drop for LocalScopeHandle<'scope> { - fn drop(&mut self) { - unsafe { - if !self.scope.is_null() { - (*self.scope).job_completed_ok(); - } - } - } -} - -/// We assert that the `Self` type remains valid until a -/// method is called, and that `'scope` will not end until -/// that point. -unsafe impl<'scope> ScopeHandle<'scope> for LocalScopeHandle<'scope> { - unsafe fn spawn_task(&self, task: Arc) { - let scope = &*self.scope; - scope.registry.submit_task(task); - } - - fn ok(self) { - mem::drop(self); - } - - fn panicked(self, err: Box) { - unsafe { - (*self.scope).job_panicked(err); - mem::forget(self); // no need to run dtor now - } - } -} diff --git a/rayon-core/src/scope/mod.rs b/rayon-core/src/scope/mod.rs index 9a9457ff5..198c50617 100644 --- a/rayon-core/src/scope/mod.rs +++ b/rayon-core/src/scope/mod.rs @@ -17,7 +17,6 @@ use std::sync::atomic::{AtomicPtr, Ordering}; use std::sync::Arc; use crate::unwind; -mod internal; #[cfg(test)] mod test; diff --git a/rayon-core/src/thread_pool/internal.rs b/rayon-core/src/thread_pool/internal.rs deleted file mode 100644 index e28c37fb4..000000000 --- a/rayon-core/src/thread_pool/internal.rs +++ /dev/null @@ -1,65 +0,0 @@ -#![cfg(rayon_unstable)] - -use super::ThreadPool; -use crate::internal::task::{ScopeHandle, Task, ToScopeHandle}; -use crate::registry::Registry; -use std::any::Any; -use std::fmt; -use std::sync::Arc; - -impl ToScopeHandle<'static> for ThreadPool { - type ScopeHandle = ThreadPoolScopeHandle; - - fn to_scope_handle(&self) -> Self::ScopeHandle { - unsafe { ThreadPoolScopeHandle::new(self.registry.clone()) } - } -} - -pub struct ThreadPoolScopeHandle { - registry: Arc, -} - -impl fmt::Debug for ThreadPoolScopeHandle { - fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt.debug_struct("ThreadPoolScopeHandle") - .field("pool", &self.registry.id()) - .finish() - } -} - -impl ThreadPoolScopeHandle { - /// Caller asserts that the registry has not yet terminated. - unsafe fn new(registry: Arc) -> Self { - registry.increment_terminate_count(); - ThreadPoolScopeHandle { registry } - } -} - -impl Drop for ThreadPoolScopeHandle { - fn drop(&mut self) { - self.registry.terminate(); - } -} - -/// We assert that: -/// -/// (a) the scope valid remains valid until a completion method -/// is called. In this case, "remains valid" means that the -/// registry is not terminated. This is true because we -/// acquire a "termination count" in `StaticFutureScope::new()` -/// which is not released until `future_panicked()` or -/// `future_completed()` is invoked. -/// (b) the lifetime `'static` will not end until a completion -/// method is called. This is true because `'static` doesn't -/// end until the end of the program. -unsafe impl ScopeHandle<'static> for ThreadPoolScopeHandle { - unsafe fn spawn_task(&self, task: Arc) { - self.registry.submit_task(task); - } - - fn ok(self) {} - - fn panicked(self, err: Box) { - self.registry.handle_panic(err); - } -} diff --git a/rayon-core/src/thread_pool/mod.rs b/rayon-core/src/thread_pool/mod.rs index d6cc8bd46..f701b92ed 100644 --- a/rayon-core/src/thread_pool/mod.rs +++ b/rayon-core/src/thread_pool/mod.rs @@ -15,7 +15,6 @@ use crate::{scope, Scope}; use crate::{scope_fifo, ScopeFifo}; use crate::{ThreadPoolBuildError, ThreadPoolBuilder}; -mod internal; mod test; /// Represents a user created [thread-pool]. @@ -71,27 +70,6 @@ impl ThreadPool { Ok(ThreadPool { registry }) } - /// Returns a handle to the global thread pool. This is the pool - /// that Rayon will use by default when you perform a `join()` or - /// `scope()` operation, if no other thread-pool is installed. If - /// no global thread-pool has yet been started when this function - /// is called, then the global thread-pool will be created (with - /// the default configuration). If you wish to configure the - /// global thread-pool differently, then you can use [the - /// `rayon::initialize()` function][f] to do so. - /// - /// [f]: fn.initialize.html - #[cfg(rayon_unstable)] - pub fn global() -> &'static Arc { - lazy_static! { - static ref DEFAULT_THREAD_POOL: Arc = Arc::new(ThreadPool { - registry: Registry::global() - }); - } - - &DEFAULT_THREAD_POOL - } - /// Executes `op` within the threadpool. Any attempts to use /// `join`, `scope`, or parallel iterators will then operate /// within that threadpool. From 4e4025693f2e155abc98486b8e6f04e6e33e0a9a Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 19 Dec 2019 11:08:33 -0800 Subject: [PATCH 3/9] Update ci/compat-Cargo.lock --- ci/compat-Cargo.lock | 226 +++++++++++++++++++------------------------ 1 file changed, 97 insertions(+), 129 deletions(-) diff --git a/ci/compat-Cargo.lock b/ci/compat-Cargo.lock index 35201a99b..dd1ac03b8 100644 --- a/ci/compat-Cargo.lock +++ b/ci/compat-Cargo.lock @@ -15,7 +15,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "line_drawing 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rusttype 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "rusttype 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", "xdg 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -31,16 +31,13 @@ name = "approx" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "arrayvec" -version = "0.4.12" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "autocfg" @@ -53,8 +50,8 @@ version = "0.3.40" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -63,8 +60,8 @@ name = "backtrace-sys" version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -92,12 +89,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.47" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cfg-if" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -106,7 +103,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gleam 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -115,7 +112,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "approx 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -137,7 +134,7 @@ dependencies = [ "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -147,7 +144,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -163,7 +160,7 @@ dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -181,7 +178,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -202,20 +199,10 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "derivative" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "dlib" version = "0.4.1" @@ -236,8 +223,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -283,8 +270,8 @@ name = "getrandom" version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -324,7 +311,7 @@ dependencies = [ "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "gl_generator 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glutin 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)", + "glutin 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", "takeable-option 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -332,7 +319,7 @@ dependencies = [ [[package]] name = "glutin" -version = "0.21.1" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -340,7 +327,6 @@ dependencies = [ "cocoa 0.18.5 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", - "derivative 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "glutin_egl_sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "glutin_emscripten_sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "glutin_gles2_sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -398,10 +384,10 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -416,7 +402,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.65" +version = "0.2.66" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -424,7 +410,7 @@ name = "libloading" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -433,12 +419,12 @@ name = "line_drawing" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "lock_api" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -449,7 +435,7 @@ name = "log" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -457,7 +443,7 @@ name = "malloc_buf" version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -475,7 +461,7 @@ name = "memmap" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -493,17 +479,12 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "nodrop" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "num" version = "0.2.0" @@ -514,7 +495,7 @@ dependencies = [ "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", "num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", "num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -524,7 +505,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -533,7 +514,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -542,7 +523,7 @@ version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -552,7 +533,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -563,12 +544,12 @@ dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -579,8 +560,8 @@ name = "num_cpus" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "hermit-abi 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -606,7 +587,7 @@ name = "ordered-float" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -622,7 +603,7 @@ name = "parking_lot" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lock_api 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -632,9 +613,9 @@ name = "parking_lot_core" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", @@ -694,7 +675,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -712,7 +693,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -786,7 +767,7 @@ name = "rand_jitter" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -798,7 +779,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -831,10 +812,10 @@ dependencies = [ [[package]] name = "raw-window-handle" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -862,8 +843,8 @@ dependencies = [ "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rayon-core 1.6.1", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -874,7 +855,7 @@ dependencies = [ "crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -890,15 +871,15 @@ dependencies = [ "fixedbitset 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "glium 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "odds 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.2.1", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -947,13 +928,21 @@ dependencies = [ [[package]] name = "rusttype" -version = "0.7.7" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rusttype 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rusttype" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "approx 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "stb_truetype 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "stb_truetype 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -989,20 +978,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.102" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.102" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1011,7 +1000,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1038,14 +1027,6 @@ dependencies = [ "wayland-protocols 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "stb_truetype" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "stb_truetype 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "stb_truetype" version = "0.3.1" @@ -1056,22 +1037,12 @@ dependencies = [ [[package]] name = "strsim" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "syn" -version = "0.15.44" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "syn" -version = "1.0.8" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1097,7 +1068,7 @@ name = "time" version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1144,7 +1115,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "downcast-rs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "wayland-commons 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", "wayland-scanner 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1230,12 +1201,12 @@ dependencies = [ "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "raw-window-handle 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "smithay-client-toolkit 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "wayland-client 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1248,7 +1219,7 @@ version = "2.18.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1268,7 +1239,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum andrew 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9b7f09f89872c2b6b29e319377b1fbe91c6f5947df19a25596e121cf19a7b35e" "checksum android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" "checksum approx 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" -"checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +"checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" "checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" "checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" @@ -1276,8 +1247,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" "checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" -"checksum cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)" = "aa87058dce70a3ff5621797f1506cb837edd02ac4c0ae642b4542dce802908b8" -"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" +"checksum cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)" = "f52a465a666ca3d838ebbf08b241383421412fe7ebb463527bba275526d89f76" +"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" "checksum cgl 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "55e7ec0b74fe5897894cbc207092c577e87c52f8a59e8ca8d97ef37551f60a49" "checksum cgmath 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "283944cdecc44bf0b8dd010ec9af888d3b4f142844fdbe026c20ef68148d6fe7" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" @@ -1289,7 +1260,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" "checksum crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dfd6515864a82d2f877b42813d4553292c6659498c9a2aa31bab5a15243c2700" "checksum crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" -"checksum derivative 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "942ca430eef7a3806595a6737bc388bf51adb888d3fc0dd1b50f1c170167ee3a" "checksum dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "77e51249a9d823a4cb79e3eca6dcd756153e8ed0157b6c04775d04bf1b13b76a" "checksum doc-comment 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "923dea538cea0aa3025e8685b20d6ee21ef99c4f77e954a30febbaac5ec73a97" "checksum docopt 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f525a586d310c87df72ebcd98009e57f1cc030c8c268305287a476beb653969" @@ -1305,19 +1275,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum gl_generator 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ca98bbde17256e02d17336a6bdb5a50f7d0ccacee502e191d3e3d0ec2f96f84a" "checksum gleam 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "cae10d7c99d0e77b4766e850a60898a17c1abaf01075531f1066f03dc7dc5fc5" "checksum glium 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6d7d887755ee729c5204e151db1c81b0b5beb809ef5e01d0eb14847e80a71256" -"checksum glutin 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)" = "938ce7a2b1bbfe1535166133bea3f9c1b46350d2794b49561303575e9e1b9949" +"checksum glutin 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5371b35b309dace06be1b81b5f6adb1c9de578b7dbe1e74bf7e4ef762cf6febd" "checksum glutin_egl_sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "772edef3b28b8ad41e4ea202748e65eefe8e5ffd1f4535f1219793dbb20b3d4c" "checksum glutin_emscripten_sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "245b3fdb08df6ffed7585365851f8404af9c7e2dd4b59f15262e968b6a95a0c7" "checksum glutin_gles2_sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "89996c30857ae1b4de4b5189abf1ea822a20a9fe9e1c93e5e7b862ff0bdd5cdf" "checksum glutin_glx_sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1290a5ca5e46fcfa7f66f949cc9d9194b2cb6f2ed61892c8c2b82343631dba57" "checksum glutin_wgl_sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f801bbc91efc22dd1c4818a47814fc72bf74d024510451b119381579bfa39021" -"checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" +"checksum hermit-abi 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f629dc602392d3ec14bfc8a09b5e644d7ffd725102b48b81e59f90f2633621d7" "checksum khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -"checksum libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8" +"checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" "checksum libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" "checksum line_drawing 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9" -"checksum lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8912e782533a93a167888781b836336a6ca5da6175c05944c86cf28c31104dc" +"checksum lock_api 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e57b3997725d2b60dbec1297f6c2e2957cc383db1cebd6be812163f969c7d586" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" "checksum malloc_buf 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" "checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" @@ -1325,14 +1295,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" "checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" "checksum nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" -"checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" "checksum num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cf4825417e1e1406b3782a8ce92f4d53f26ec055e3622e1881ca8e9f5f9e08db" "checksum num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f9c3f34cdd24f334cb265d9bf8bfa8a241920d026916785747a92f0e55541a1a" "checksum num-complex 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fcb0cf31fb3ff77e6d2a6ebd6800df7fdcd106f2ad89113c9130bcd07f93dffc" "checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" "checksum num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "76bd5272412d173d6bf9afdf98db8612bbabc9a7a830b7bfc9c188911716132e" "checksum num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2885278d5fe2adc2f75ced642d52d879bffaceb5a2e0b1d4309ffdfb239b454" -"checksum num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "443c53b3c3531dfcbfa499d8893944db78474ad7a1d87fa2d94d1a2231693ac6" +"checksum num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c81ffc11c212fa327657cb19dd85eb7419e163b5b076bede2bdb5c974c07e4" "checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" "checksum objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" "checksum odds 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a9a18d7081eb052145753e982d7b8de495f15f74636d0d963f09116581eab665" @@ -1362,7 +1331,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" "checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" "checksum rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8" -"checksum raw-window-handle 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9db80d08d3ed847ce4fb3def46de0af4bfb6155bd09bd6eaf28b5ac72541c1f1" +"checksum raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" "checksum rawpointer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ebac11a9d2e11f2af219b8b8d833b76b1ea0e054aa0e8d8e9e4cbde353bdf019" "checksum rawslice 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "22b23b9f57ea250c6db4b21e2897b43ff08209217ca8260469fae6c0f9ad7e25" "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" @@ -1371,22 +1340,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -"checksum rusttype 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)" = "654103d61a05074b268a107cf6581ce120f0fc0115f2610ed9dfea363bb81139" +"checksum rusttype 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" +"checksum rusttype 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "14a911032fb5791ccbeec9f28fdcb9bf0983b81f227bafdfd227c658d0731c8a" "checksum same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" "checksum scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" "checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4b39bd9b0b087684013a792c59e3e07a46a01d2322518d8a1104641a0b1be0" -"checksum serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "ca13fc1a832f793322228923fbb3aba9f3f44444898f835d31ad1b74fa0a2bf8" +"checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" +"checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" "checksum shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" "checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" "checksum smithay-client-toolkit 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2ccb8c57049b2a34d2cc2b203fa785020ba0129d31920ef0d317430adaf748fa" -"checksum stb_truetype 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "9d1bec4382294c5a680fcebd29f8451e8d8c04479a026f6909004e2ab1cb425d" "checksum stb_truetype 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" -"checksum strsim 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "032c03039aae92b350aad2e3779c352e104d919cb192ba2fabbd7b831ce4f0f6" -"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -"checksum syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "661641ea2aa15845cddeb97dad000d22070bb5c1fb456b96c1cba883ec691e92" +"checksum strsim 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" +"checksum syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238" "checksum takeable-option 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d77adff586b9bd922afef7791341ed94b09845e11225929217efe949e6366d43" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" From a1db0fe390e87e8316fd40240c88fbc0b2b79a7c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 19 Dec 2019 11:32:36 -0800 Subject: [PATCH 4/9] Fix clippy::flat_map_identity --- src/iter/extend.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iter/extend.rs b/src/iter/extend.rs index 10f0e9a95..114375f72 100644 --- a/src/iter/extend.rs +++ b/src/iter/extend.rs @@ -287,7 +287,7 @@ impl<'a> ParallelExtend<&'a char> for String { fn string_reserve>(string: &mut String, list: &LinkedList>) { let len = list .iter() - .flat_map(|vec| vec) + .flatten() .map(T::as_ref) .map(str::len) .sum(); From e02f439bbfacc534b0a1c07aa6d5bfdc76ed85b8 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 19 Dec 2019 11:49:49 -0800 Subject: [PATCH 5/9] Remove useless 'use crate;' in favor of the crate prelude --- examples/cpu_monitor.rs | 1 - rayon-core/src/lib.rs | 2 -- rayon-core/tests/scope_join.rs | 2 -- rayon-demo/src/factorial/mod.rs | 2 -- rayon-demo/src/fibonacci/mod.rs | 2 -- rayon-demo/src/join_microbench.rs | 1 - rayon-demo/src/life/mod.rs | 1 - rayon-demo/src/main.rs | 3 --- rayon-demo/src/matmul/bench.rs | 2 -- rayon-demo/src/matmul/mod.rs | 1 - rayon-demo/src/mergesort/bench.rs | 2 -- rayon-demo/src/mergesort/mod.rs | 1 - rayon-demo/src/nbody/bench.rs | 2 -- rayon-demo/src/nbody/mod.rs | 1 - rayon-demo/src/pythagoras/mod.rs | 1 - rayon-demo/src/quicksort/bench.rs | 2 -- rayon-demo/src/quicksort/mod.rs | 1 - rayon-demo/src/sieve/bench.rs | 2 -- rayon-demo/src/sieve/mod.rs | 1 - rayon-demo/src/tsp/bench.rs | 1 - rayon-demo/src/tsp/solver.rs | 1 - src/iter/empty.rs | 1 - src/option.rs | 1 - src/slice/mergesort.rs | 1 - src/slice/quicksort.rs | 1 - src/vec.rs | 1 - 26 files changed, 37 deletions(-) diff --git a/examples/cpu_monitor.rs b/examples/cpu_monitor.rs index bc449569a..1ad1db763 100644 --- a/examples/cpu_monitor.rs +++ b/examples/cpu_monitor.rs @@ -2,7 +2,6 @@ extern crate serde_derive; use docopt::Docopt; -use rayon; use std::io; use std::process; diff --git a/rayon-core/src/lib.rs b/rayon-core/src/lib.rs index 5365fe284..fd9c360ab 100644 --- a/rayon-core/src/lib.rs +++ b/rayon-core/src/lib.rs @@ -64,8 +64,6 @@ pub use self::thread_pool::current_thread_has_pending_tasks; pub use self::thread_pool::current_thread_index; pub use self::thread_pool::ThreadPool; -use crossbeam_utils; -use num_cpus; use self::registry::{CustomSpawn, DefaultSpawn, ThreadSpawn}; /// Returns the number of threads in the current registry. If this diff --git a/rayon-core/tests/scope_join.rs b/rayon-core/tests/scope_join.rs index 3bf07d6b5..9d88133bc 100644 --- a/rayon-core/tests/scope_join.rs +++ b/rayon-core/tests/scope_join.rs @@ -1,5 +1,3 @@ -use rayon_core; - /// Test that one can emulate join with `scope`: fn pseudo_join(f: F, g: G) where diff --git a/rayon-demo/src/factorial/mod.rs b/rayon-demo/src/factorial/mod.rs index 3ec42ca75..16ef9991f 100644 --- a/rayon-demo/src/factorial/mod.rs +++ b/rayon-demo/src/factorial/mod.rs @@ -1,10 +1,8 @@ //! Benchmark Factorial N! = 1×2×⋯×N use num::{BigUint, One}; -use rayon; use rayon::prelude::*; use std::ops::Mul; -use test; const N: u32 = 9999; diff --git a/rayon-demo/src/fibonacci/mod.rs b/rayon-demo/src/fibonacci/mod.rs index 21d8be86c..1500871fc 100644 --- a/rayon-demo/src/fibonacci/mod.rs +++ b/rayon-demo/src/fibonacci/mod.rs @@ -15,8 +15,6 @@ extern crate test; -use rayon; - const N: u32 = 32; const FN: u32 = 2_178_309; diff --git a/rayon-demo/src/join_microbench.rs b/rayon-demo/src/join_microbench.rs index a978498f4..f56206ef9 100644 --- a/rayon-demo/src/join_microbench.rs +++ b/rayon-demo/src/join_microbench.rs @@ -1,6 +1,5 @@ //! Some microbenchmarks that stress test a pure `join` path. -use rayon; use rayon::prelude::*; use std::usize; use test::Bencher; diff --git a/rayon-demo/src/life/mod.rs b/rayon-demo/src/life/mod.rs index 550685b15..25cc2998c 100644 --- a/rayon-demo/src/life/mod.rs +++ b/rayon-demo/src/life/mod.rs @@ -21,7 +21,6 @@ use std::iter::repeat; use std::num::Wrapping; use std::sync::Arc; use std::thread; -use time; use docopt::Docopt; use rayon::iter::ParallelBridge; diff --git a/rayon-demo/src/main.rs b/rayon-demo/src/main.rs index 9494e992a..c1be50236 100644 --- a/rayon-demo/src/main.rs +++ b/rayon-demo/src/main.rs @@ -47,9 +47,6 @@ extern crate winapi; // life #[cfg(test)] extern crate test; -use rand; -use rand_xorshift; - const USAGE: &str = " Usage: rayon-demo bench rayon-demo [ options ] diff --git a/rayon-demo/src/matmul/bench.rs b/rayon-demo/src/matmul/bench.rs index 6426357ef..81333495e 100644 --- a/rayon-demo/src/matmul/bench.rs +++ b/rayon-demo/src/matmul/bench.rs @@ -1,5 +1,3 @@ -use test; - const ROW_SIZE: usize = 256; #[bench] diff --git a/rayon-demo/src/matmul/mod.rs b/rayon-demo/src/matmul/mod.rs index 954e8877e..a74ac7ef4 100644 --- a/rayon-demo/src/matmul/mod.rs +++ b/rayon-demo/src/matmul/mod.rs @@ -17,7 +17,6 @@ pub struct Args { } use docopt::Docopt; -use rayon; use rayon::prelude::*; use std::time::Instant; diff --git a/rayon-demo/src/mergesort/bench.rs b/rayon-demo/src/mergesort/bench.rs index a643ebbd5..ad6a23d5d 100644 --- a/rayon-demo/src/mergesort/bench.rs +++ b/rayon-demo/src/mergesort/bench.rs @@ -1,5 +1,3 @@ -use test; - // Size to use when doing `cargo bench`; extensively tuned to run in // "not too long" on my laptop -nmatsakis const BENCH_SIZE: usize = 250_000_000 / 512; diff --git a/rayon-demo/src/mergesort/mod.rs b/rayon-demo/src/mergesort/mod.rs index eb5435e9d..f7813deba 100644 --- a/rayon-demo/src/mergesort/mod.rs +++ b/rayon-demo/src/mergesort/mod.rs @@ -25,7 +25,6 @@ pub struct Args { } use docopt::Docopt; -use rayon; use std::cmp::max; use std::time::Instant; diff --git a/rayon-demo/src/nbody/bench.rs b/rayon-demo/src/nbody/bench.rs index 1e44b388e..032ccbbb6 100644 --- a/rayon-demo/src/nbody/bench.rs +++ b/rayon-demo/src/nbody/bench.rs @@ -1,5 +1,3 @@ -use test; - use super::nbody::NBodyBenchmark; // Because benchmarks run iteratively, use smaller constants by default: diff --git a/rayon-demo/src/nbody/mod.rs b/rayon-demo/src/nbody/mod.rs index b359a89e2..c65febcde 100644 --- a/rayon-demo/src/nbody/mod.rs +++ b/rayon-demo/src/nbody/mod.rs @@ -1,5 +1,4 @@ use docopt::Docopt; -use time; #[cfg(test)] mod bench; diff --git a/rayon-demo/src/pythagoras/mod.rs b/rayon-demo/src/pythagoras/mod.rs index 980f12ade..5d5b88a1e 100644 --- a/rayon-demo/src/pythagoras/mod.rs +++ b/rayon-demo/src/pythagoras/mod.rs @@ -6,7 +6,6 @@ use rayon::prelude::*; use rayon::range::Iter; use std::ops::Add; use std::usize; -use test; /// Use Euclid's formula to count Pythagorean triples /// diff --git a/rayon-demo/src/quicksort/bench.rs b/rayon-demo/src/quicksort/bench.rs index 70620ec1c..5b4fc1e7b 100644 --- a/rayon-demo/src/quicksort/bench.rs +++ b/rayon-demo/src/quicksort/bench.rs @@ -1,5 +1,3 @@ -use test; - use super::{Parallel, Sequential}; // Size to use when doing `cargo bench`; extensively tuned to run in diff --git a/rayon-demo/src/quicksort/mod.rs b/rayon-demo/src/quicksort/mod.rs index 504e16830..36696d496 100644 --- a/rayon-demo/src/quicksort/mod.rs +++ b/rayon-demo/src/quicksort/mod.rs @@ -25,7 +25,6 @@ pub struct Args { use docopt::Docopt; use rand::distributions::Standard; use rand::Rng; -use rayon; use std::time::Instant; pub trait Joiner { diff --git a/rayon-demo/src/sieve/bench.rs b/rayon-demo/src/sieve/bench.rs index 79077384d..8125fbe0b 100644 --- a/rayon-demo/src/sieve/bench.rs +++ b/rayon-demo/src/sieve/bench.rs @@ -1,5 +1,3 @@ -use test; - use super::NUM_PRIMES; const MAGNITUDE: usize = 7; diff --git a/rayon-demo/src/sieve/mod.rs b/rayon-demo/src/sieve/mod.rs index 5ea1f6297..1f4c5079a 100644 --- a/rayon-demo/src/sieve/mod.rs +++ b/rayon-demo/src/sieve/mod.rs @@ -42,7 +42,6 @@ mod bench; use docopt::Docopt; use odds::stride::StrideMut; use rayon::prelude::*; -use time; const CHUNK_SIZE: usize = 100_000; diff --git a/rayon-demo/src/tsp/bench.rs b/rayon-demo/src/tsp/bench.rs index 9aecd3c68..28692ac7b 100644 --- a/rayon-demo/src/tsp/bench.rs +++ b/rayon-demo/src/tsp/bench.rs @@ -1,5 +1,4 @@ use std::path::Path; -use test; use super::graph::Node; use super::parse_solver; diff --git a/rayon-demo/src/tsp/solver.rs b/rayon-demo/src/tsp/solver.rs index b461b3a22..21c908b6e 100644 --- a/rayon-demo/src/tsp/solver.rs +++ b/rayon-demo/src/tsp/solver.rs @@ -1,4 +1,3 @@ -use rayon; use std::collections::BinaryHeap; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::{Arc, Mutex}; diff --git a/src/iter/empty.rs b/src/iter/empty.rs index eb5797c9d..85a2e5fd9 100644 --- a/src/iter/empty.rs +++ b/src/iter/empty.rs @@ -1,7 +1,6 @@ use crate::iter::plumbing::*; use crate::iter::*; -use std; use std::fmt; use std::marker::PhantomData; diff --git a/src/option.rs b/src/option.rs index fc1f7d286..0f56896f0 100644 --- a/src/option.rs +++ b/src/option.rs @@ -7,7 +7,6 @@ use crate::iter::plumbing::*; use crate::iter::*; -use std; use std::sync::atomic::{AtomicBool, Ordering}; /// A parallel iterator over the value in [`Some`] variant of an [`Option`]. diff --git a/src/slice/mergesort.rs b/src/slice/mergesort.rs index 07a3e0c30..a007cae80 100644 --- a/src/slice/mergesort.rs +++ b/src/slice/mergesort.rs @@ -5,7 +5,6 @@ //! `MergesortResult` and leaves descending arrays intact. use crate::iter::*; -use rayon_core; use crate::slice::ParallelSliceMut; use std::mem; use std::mem::size_of; diff --git a/src/slice/quicksort.rs b/src/slice/quicksort.rs index 95df40124..b98507351 100644 --- a/src/slice/quicksort.rs +++ b/src/slice/quicksort.rs @@ -4,7 +4,6 @@ //! The only difference from the original is that calls to `recurse` are executed in parallel using //! `rayon_core::join`. -use rayon_core; use std::cmp; use std::mem; use std::ptr; diff --git a/src/vec.rs b/src/vec.rs index 617cfac18..bfbf9395a 100644 --- a/src/vec.rs +++ b/src/vec.rs @@ -7,7 +7,6 @@ use crate::iter::plumbing::*; use crate::iter::*; -use std; /// Parallel iterator that moves out of a vector. #[derive(Debug, Clone)] From 9b92c7deb93aedda14ca4401c5fc40a7cff596b0 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 19 Dec 2019 11:52:51 -0800 Subject: [PATCH 6/9] cargo fmt --- rayon-core/src/job.rs | 4 ++-- rayon-core/src/join/mod.rs | 2 +- rayon-core/src/join/test.rs | 4 ++-- rayon-core/src/registry.rs | 12 +++++++----- rayon-core/src/scope/mod.rs | 2 +- rayon-core/src/scope/test.rs | 6 +++--- rayon-core/src/spawn/mod.rs | 2 +- rayon-core/src/test.rs | 4 ++-- rayon-core/src/thread_pool/mod.rs | 6 +++--- rayon-demo/src/main.rs | 4 ++-- src/iter/extend.rs | 7 +------ src/range.rs | 2 +- src/range_inclusive.rs | 2 +- 13 files changed, 27 insertions(+), 30 deletions(-) diff --git a/rayon-core/src/job.rs b/rayon-core/src/job.rs index c56a69254..27510cff2 100644 --- a/rayon-core/src/job.rs +++ b/rayon-core/src/job.rs @@ -1,9 +1,9 @@ -use crossbeam_queue::SegQueue; use crate::latch::Latch; +use crate::unwind; +use crossbeam_queue::SegQueue; use std::any::Any; use std::cell::UnsafeCell; use std::mem; -use crate::unwind; pub(super) enum JobResult { None, diff --git a/rayon-core/src/join/mod.rs b/rayon-core/src/join/mod.rs index c0aa06bff..295f97bc2 100644 --- a/rayon-core/src/join/mod.rs +++ b/rayon-core/src/join/mod.rs @@ -2,8 +2,8 @@ use crate::job::StackJob; use crate::latch::{LatchProbe, SpinLatch}; use crate::log::Event::*; use crate::registry::{self, WorkerThread}; -use std::any::Any; use crate::unwind; +use std::any::Any; use crate::FnContext; diff --git a/rayon-core/src/join/test.rs b/rayon-core/src/join/test.rs index 70afaffe2..7b5c7a2bb 100644 --- a/rayon-core/src/join/test.rs +++ b/rayon-core/src/join/test.rs @@ -1,11 +1,11 @@ //! Tests for the join code. use crate::join::*; +use crate::unwind; +use crate::ThreadPoolBuilder; use rand::distributions::Standard; use rand::{Rng, SeedableRng}; use rand_xorshift::XorShiftRng; -use crate::unwind; -use crate::ThreadPoolBuilder; fn quick_sort(v: &mut [T]) { if v.len() <= 1 { diff --git a/rayon-core/src/registry.rs b/rayon-core/src/registry.rs index ab6cbceee..20ec2549b 100644 --- a/rayon-core/src/registry.rs +++ b/rayon-core/src/registry.rs @@ -1,9 +1,14 @@ -use crossbeam_deque::{Steal, Stealer, Worker}; -use crossbeam_queue::SegQueue; use crate::job::{JobFifo, JobRef, StackJob}; use crate::latch::{CountLatch, Latch, LatchProbe, LockLatch, SpinLatch, TickleLatch}; use crate::log::Event::*; use crate::sleep::Sleep; +use crate::unwind; +use crate::util::leak; +use crate::{ + ErrorKind, ExitHandler, PanicHandler, StartHandler, ThreadPoolBuildError, ThreadPoolBuilder, +}; +use crossbeam_deque::{Steal, Stealer, Worker}; +use crossbeam_queue::SegQueue; use std::any::Any; use std::cell::Cell; use std::collections::hash_map::DefaultHasher; @@ -18,9 +23,6 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::{Arc, Once}; use std::thread; use std::usize; -use crate::unwind; -use crate::util::leak; -use crate::{ErrorKind, ExitHandler, PanicHandler, StartHandler, ThreadPoolBuildError, ThreadPoolBuilder}; /// Thread builder used for customization via /// [`ThreadPoolBuilder::spawn_handler`](struct.ThreadPoolBuilder.html#method.spawn_handler). diff --git a/rayon-core/src/scope/mod.rs b/rayon-core/src/scope/mod.rs index 198c50617..bca4bd0a1 100644 --- a/rayon-core/src/scope/mod.rs +++ b/rayon-core/src/scope/mod.rs @@ -8,6 +8,7 @@ use crate::job::{HeapJob, JobFifo}; use crate::latch::{CountLatch, Latch}; use crate::log::Event::*; use crate::registry::{in_worker, Registry, WorkerThread}; +use crate::unwind; use std::any::Any; use std::fmt; use std::marker::PhantomData; @@ -15,7 +16,6 @@ use std::mem; use std::ptr; use std::sync::atomic::{AtomicPtr, Ordering}; use std::sync::Arc; -use crate::unwind; #[cfg(test)] mod test; diff --git a/rayon-core/src/scope/test.rs b/rayon-core/src/scope/test.rs index e3bd3e26f..3d855ecda 100644 --- a/rayon-core/src/scope/test.rs +++ b/rayon-core/src/scope/test.rs @@ -1,3 +1,6 @@ +use crate::unwind; +use crate::ThreadPoolBuilder; +use crate::{scope, scope_fifo, Scope}; use rand::{Rng, SeedableRng}; use rand_xorshift::XorShiftRng; use std::cmp; @@ -5,9 +8,6 @@ use std::iter::once; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Mutex; use std::vec; -use crate::unwind; -use crate::ThreadPoolBuilder; -use crate::{scope, scope_fifo, Scope}; #[test] fn scope_empty() { diff --git a/rayon-core/src/spawn/mod.rs b/rayon-core/src/spawn/mod.rs index 9dabb667a..ae418aad2 100644 --- a/rayon-core/src/spawn/mod.rs +++ b/rayon-core/src/spawn/mod.rs @@ -1,8 +1,8 @@ use crate::job::*; use crate::registry::Registry; +use crate::unwind; use std::mem; use std::sync::Arc; -use crate::unwind; /// Fires off a task into the Rayon threadpool in the "static" or /// "global" scope. Just like a standard thread, this task is not diff --git a/rayon-core/src/test.rs b/rayon-core/src/test.rs index b9fae03cd..015d3ec96 100644 --- a/rayon-core/src/test.rs +++ b/rayon-core/src/test.rs @@ -1,10 +1,10 @@ #![cfg(test)] -use std::sync::atomic::{AtomicUsize, Ordering}; -use std::sync::{Arc, Barrier}; #[allow(deprecated)] use crate::Configuration; use crate::{ThreadPoolBuildError, ThreadPoolBuilder}; +use std::sync::atomic::{AtomicUsize, Ordering}; +use std::sync::{Arc, Barrier}; #[test] fn worker_thread_index() { diff --git a/rayon-core/src/thread_pool/mod.rs b/rayon-core/src/thread_pool/mod.rs index f701b92ed..065d236e0 100644 --- a/rayon-core/src/thread_pool/mod.rs +++ b/rayon-core/src/thread_pool/mod.rs @@ -6,14 +6,14 @@ use crate::join; use crate::registry::{Registry, ThreadSpawn, WorkerThread}; use crate::spawn; -use std::error::Error; -use std::fmt; -use std::sync::Arc; #[allow(deprecated)] use crate::Configuration; use crate::{scope, Scope}; use crate::{scope_fifo, ScopeFifo}; use crate::{ThreadPoolBuildError, ThreadPoolBuilder}; +use std::error::Error; +use std::fmt; +use std::sync::Arc; mod test; diff --git a/rayon-demo/src/main.rs b/rayon-demo/src/main.rs index c1be50236..f348a4812 100644 --- a/rayon-demo/src/main.rs +++ b/rayon-demo/src/main.rs @@ -42,10 +42,10 @@ extern crate serde_derive; // all extern crate glium; // nbody #[macro_use] extern crate lazy_static; // find -#[cfg(windows)] -extern crate winapi; // life #[cfg(test)] extern crate test; +#[cfg(windows)] +extern crate winapi; // life const USAGE: &str = " Usage: rayon-demo bench diff --git a/src/iter/extend.rs b/src/iter/extend.rs index 114375f72..b107c6b79 100644 --- a/src/iter/extend.rs +++ b/src/iter/extend.rs @@ -285,12 +285,7 @@ impl<'a> ParallelExtend<&'a char> for String { } fn string_reserve>(string: &mut String, list: &LinkedList>) { - let len = list - .iter() - .flatten() - .map(T::as_ref) - .map(str::len) - .sum(); + let len = list.iter().flatten().map(T::as_ref).map(str::len).sum(); string.reserve(len); } diff --git a/src/range.rs b/src/range.rs index 67b8e0b01..f3b0c5181 100644 --- a/src/range.rs +++ b/src/range.rs @@ -286,8 +286,8 @@ fn test_u128_opt_len() { #[test] #[cfg(target_pointer_width = "64")] fn test_usize_i64_overflow() { - use std::i64; use crate::ThreadPoolBuilder; + use std::i64; let iter = (-2..i64::MAX).into_par_iter(); assert_eq!(iter.opt_len(), Some(i64::MAX as usize + 2)); diff --git a/src/range_inclusive.rs b/src/range_inclusive.rs index 7b224f3a3..c1757701a 100644 --- a/src/range_inclusive.rs +++ b/src/range_inclusive.rs @@ -191,8 +191,8 @@ fn test_u128_opt_len() { #[test] #[cfg(target_pointer_width = "64")] fn test_usize_i64_overflow() { - use std::i64; use crate::ThreadPoolBuilder; + use std::i64; let iter = (-2..=i64::MAX).into_par_iter(); assert_eq!(iter.opt_len(), Some(i64::MAX as usize + 3)); From b98bb23f0595cbf56afba8f641b366a0433f002e Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 19 Dec 2019 12:15:06 -0800 Subject: [PATCH 7/9] Remove unneeded extern crate statements --- Cargo.toml | 6 ++++-- README.md | 6 ------ ci/compat-Cargo.lock | 4 ---- examples/cpu_monitor.rs | 5 +---- rayon-core/src/lib.rs | 8 +------- rayon-core/src/log.rs | 2 +- rayon-core/tests/scoped_threadpool.rs | 5 +---- rayon-core/tests/stack_overflow_crash.rs | 3 --- rayon-demo/Cargo.toml | 6 ++++-- rayon-demo/src/fibonacci/mod.rs | 2 -- rayon-demo/src/find/mod.rs | 2 +- rayon-demo/src/life/mod.rs | 2 +- rayon-demo/src/main.rs | 8 -------- rayon-demo/src/matmul/mod.rs | 2 +- rayon-demo/src/mergesort/mod.rs | 2 +- rayon-demo/src/nbody/mod.rs | 4 ++-- rayon-demo/src/nbody/visualize.rs | 6 +++--- rayon-demo/src/noop/mod.rs | 2 +- rayon-demo/src/quicksort/mod.rs | 2 +- rayon-demo/src/sieve/mod.rs | 2 +- rayon-demo/src/str_split.rs | 2 +- rayon-demo/src/tsp/mod.rs | 2 +- rayon-demo/src/tsp/parser.rs | 4 ++-- src/iter/mod.rs | 9 --------- src/lib.rs | 9 ++------- tests/sort-panic-safe.rs | 5 +---- 26 files changed, 31 insertions(+), 79 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 541bd6f50..0a1ba44b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,6 +32,8 @@ docopt = "1" lazy_static = "1" rand = "0.7" rand_xorshift = "0.2" -serde = "1" -serde_derive = "1" doc-comment = "0.3" + +[dev-dependencies.serde] +version = "1.0.85" +features = ["derive"] diff --git a/README.md b/README.md index eedebb3ec..7db92d108 100644 --- a/README.md +++ b/README.md @@ -74,12 +74,6 @@ as: rayon = "1.1" ``` -and then add the following to your `lib.rs`: - -```rust -extern crate rayon; -``` - To use the Parallel Iterator APIs, a number of traits have to be in scope. The easiest way to bring those things into scope is to use the [Rayon prelude](https://docs.rs/rayon/*/rayon/prelude/index.html). In diff --git a/ci/compat-Cargo.lock b/ci/compat-Cargo.lock index dd1ac03b8..1d7f0dae6 100644 --- a/ci/compat-Cargo.lock +++ b/ci/compat-Cargo.lock @@ -1,5 +1,3 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. [[package]] name = "aho-corasick" version = "0.7.6" @@ -844,7 +842,6 @@ dependencies = [ "rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rayon-core 1.6.1", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -879,7 +876,6 @@ dependencies = [ "rayon 1.2.1", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/examples/cpu_monitor.rs b/examples/cpu_monitor.rs index 1ad1db763..bbe13164a 100644 --- a/examples/cpu_monitor.rs +++ b/examples/cpu_monitor.rs @@ -1,6 +1,3 @@ -#[macro_use] -extern crate serde_derive; - use docopt::Docopt; use std::io; use std::process; @@ -25,7 +22,7 @@ Options: -d N, --depth N Control how hard the dummy task works [default: 27] "; -#[derive(Deserialize)] +#[derive(serde::Deserialize)] pub struct Args { arg_scenario: String, flag_depth: usize, diff --git a/rayon-core/src/lib.rs b/rayon-core/src/lib.rs index fd9c360ab..eacdb6ca6 100644 --- a/rayon-core/src/lib.rs +++ b/rayon-core/src/lib.rs @@ -32,10 +32,6 @@ use std::io; use std::marker::PhantomData; use std::str::FromStr; -#[cfg(any(debug_assertions))] -#[macro_use] -extern crate lazy_static; - #[macro_use] mod log; #[macro_use] @@ -244,11 +240,9 @@ impl ThreadPoolBuilder { /// A scoped pool may be useful in combination with scoped thread-local variables. /// /// ``` - /// #[macro_use] - /// extern crate scoped_tls; /// # use rayon_core as rayon; /// - /// scoped_thread_local!(static POOL_DATA: Vec); + /// scoped_tls::scoped_thread_local!(static POOL_DATA: Vec); /// /// fn main() -> Result<(), rayon::ThreadPoolBuildError> { /// let pool_data = vec![1, 2, 3]; diff --git a/rayon-core/src/log.rs b/rayon-core/src/log.rs index 053d37dad..687370d0b 100644 --- a/rayon-core/src/log.rs +++ b/rayon-core/src/log.rs @@ -90,7 +90,7 @@ pub(super) enum Event { } #[cfg(debug_assertions)] -lazy_static! { +lazy_static::lazy_static! { pub(super) static ref LOG_ENV: bool = env::var("RAYON_LOG").is_ok() || env::var("RAYON_RS_LOG").is_ok(); } diff --git a/rayon-core/tests/scoped_threadpool.rs b/rayon-core/tests/scoped_threadpool.rs index fdafb7737..db3d0b874 100644 --- a/rayon-core/tests/scoped_threadpool.rs +++ b/rayon-core/tests/scoped_threadpool.rs @@ -1,13 +1,10 @@ -#[macro_use] -extern crate scoped_tls; - use crossbeam_utils::thread; use rayon_core::ThreadPoolBuilder; #[derive(PartialEq, Eq, Debug)] struct Local(i32); -scoped_thread_local!(static LOCAL: Local); +scoped_tls::scoped_thread_local!(static LOCAL: Local); #[test] fn missing_scoped_tls() { diff --git a/rayon-core/tests/stack_overflow_crash.rs b/rayon-core/tests/stack_overflow_crash.rs index ee4bc1702..61288982c 100644 --- a/rayon-core/tests/stack_overflow_crash.rs +++ b/rayon-core/tests/stack_overflow_crash.rs @@ -1,6 +1,3 @@ -#[cfg(unix)] -extern crate libc; - use rayon_core::ThreadPoolBuilder; use std::env; diff --git a/rayon-demo/Cargo.toml b/rayon-demo/Cargo.toml index 4916b83ad..67a1d2375 100644 --- a/rayon-demo/Cargo.toml +++ b/rayon-demo/Cargo.toml @@ -16,10 +16,12 @@ odds = "0.3" rand = "0.7" rand_xorshift = "0.2" regex = "1" -serde = "1" -serde_derive = "1" time = "0.1" +[dependencies.serde] +version = "1.0.85" +features = ["derive"] + [target.'cfg(unix)'.dependencies] libc = "0.2" diff --git a/rayon-demo/src/fibonacci/mod.rs b/rayon-demo/src/fibonacci/mod.rs index 1500871fc..86b8df59d 100644 --- a/rayon-demo/src/fibonacci/mod.rs +++ b/rayon-demo/src/fibonacci/mod.rs @@ -13,8 +13,6 @@ //! unless you have a whole lot of CPUs. The iterative version reveals the //! joke. -extern crate test; - const N: u32 = 32; const FN: u32 = 2_178_309; diff --git a/rayon-demo/src/find/mod.rs b/rayon-demo/src/find/mod.rs index 297d783e9..1094017e8 100644 --- a/rayon-demo/src/find/mod.rs +++ b/rayon-demo/src/find/mod.rs @@ -8,7 +8,7 @@ macro_rules! make_tests { use rayon::prelude::*; use test::Bencher; - lazy_static! { + lazy_static::lazy_static! { static ref HAYSTACK: Vec<[u32; $n]> = { let rng = crate::seeded_rng(); rng.sample_iter(&Standard) diff --git a/rayon-demo/src/life/mod.rs b/rayon-demo/src/life/mod.rs index 25cc2998c..7bdd242cc 100644 --- a/rayon-demo/src/life/mod.rs +++ b/rayon-demo/src/life/mod.rs @@ -29,7 +29,7 @@ use rayon::prelude::*; #[cfg(test)] mod bench; -#[derive(Deserialize)] +#[derive(serde::Deserialize)] pub struct Args { cmd_bench: bool, cmd_play: bool, diff --git a/rayon-demo/src/main.rs b/rayon-demo/src/main.rs index f348a4812..7fdf26f46 100644 --- a/rayon-demo/src/main.rs +++ b/rayon-demo/src/main.rs @@ -36,16 +36,8 @@ mod str_split; #[cfg(test)] mod vec_collect; -#[macro_use] -extern crate serde_derive; // all -#[macro_use] -extern crate glium; // nbody -#[macro_use] -extern crate lazy_static; // find #[cfg(test)] extern crate test; -#[cfg(windows)] -extern crate winapi; // life const USAGE: &str = " Usage: rayon-demo bench diff --git a/rayon-demo/src/matmul/mod.rs b/rayon-demo/src/matmul/mod.rs index a74ac7ef4..24ad5b1e9 100644 --- a/rayon-demo/src/matmul/mod.rs +++ b/rayon-demo/src/matmul/mod.rs @@ -10,7 +10,7 @@ Options: -h, --help Show this message. "; -#[derive(Deserialize)] +#[derive(serde::Deserialize)] pub struct Args { cmd_bench: bool, flag_size: usize, diff --git a/rayon-demo/src/mergesort/mod.rs b/rayon-demo/src/mergesort/mod.rs index f7813deba..a2f48a2df 100644 --- a/rayon-demo/src/mergesort/mod.rs +++ b/rayon-demo/src/mergesort/mod.rs @@ -18,7 +18,7 @@ Options: -h, --help Show this message. "; -#[derive(Deserialize)] +#[derive(serde::Deserialize)] pub struct Args { cmd_bench: bool, flag_size: usize, diff --git a/rayon-demo/src/nbody/mod.rs b/rayon-demo/src/nbody/mod.rs index c65febcde..a08d6c93c 100644 --- a/rayon-demo/src/nbody/mod.rs +++ b/rayon-demo/src/nbody/mod.rs @@ -41,14 +41,14 @@ Ported from the RiverTrail demo found at: https://github.com/IntelLabs/RiverTrail/tree/master/examples/nbody-webgl "; -#[derive(Copy, Clone, PartialEq, Eq, Deserialize)] +#[derive(Copy, Clone, PartialEq, Eq, serde::Deserialize)] pub enum ExecutionMode { Par, ParReduce, Seq, } -#[derive(Deserialize)] +#[derive(serde::Deserialize)] pub struct Args { cmd_bench: bool, cmd_visualize: bool, diff --git a/rayon-demo/src/nbody/visualize.rs b/rayon-demo/src/nbody/visualize.rs index dfe30e97f..57f281b05 100644 --- a/rayon-demo/src/nbody/visualize.rs +++ b/rayon-demo/src/nbody/visualize.rs @@ -16,7 +16,7 @@ struct Vertex { position: [f32; 3], } -implement_vertex!(Vertex, position); +glium::implement_vertex!(Vertex, position); fn icosahedron() -> ([Vertex; 12], Vec) { let phi = (1.0 + f32::sqrt(5.0)) / 2.0; @@ -75,7 +75,7 @@ struct Instance { world_position: [f32; 3], } -implement_vertex!(Instance, color, world_position); +glium::implement_vertex!(Instance, color, world_position); pub fn visualize_benchmarks(num_bodies: usize, mut mode: ExecutionMode) { let mut events_loop = EventsLoop::new(); @@ -181,7 +181,7 @@ pub fn visualize_benchmarks(num_bodies: usize, mut mode: ExecutionMode) { (&vertex_buffer, instance_buffer.per_instance().unwrap()), &index_buffer, &program, - &uniform! { matrix: view_proj }, + &glium::uniform! { matrix: view_proj }, ¶ms, ) .unwrap(); diff --git a/rayon-demo/src/noop/mod.rs b/rayon-demo/src/noop/mod.rs index f4515d66c..75cf8d93c 100644 --- a/rayon-demo/src/noop/mod.rs +++ b/rayon-demo/src/noop/mod.rs @@ -11,7 +11,7 @@ Options: use crate::cpu_time; use docopt::Docopt; -#[derive(Deserialize)] +#[derive(serde::Deserialize)] pub struct Args { flag_sleep: u64, flag_iters: u64, diff --git a/rayon-demo/src/quicksort/mod.rs b/rayon-demo/src/quicksort/mod.rs index 36696d496..b0ced3fa0 100644 --- a/rayon-demo/src/quicksort/mod.rs +++ b/rayon-demo/src/quicksort/mod.rs @@ -15,7 +15,7 @@ Options: -h, --help Show this message. "; -#[derive(Deserialize)] +#[derive(serde::Deserialize)] pub struct Args { cmd_bench: bool, flag_size: usize, diff --git a/rayon-demo/src/sieve/mod.rs b/rayon-demo/src/sieve/mod.rs index 1f4c5079a..9374d1397 100644 --- a/rayon-demo/src/sieve/mod.rs +++ b/rayon-demo/src/sieve/mod.rs @@ -31,7 +31,7 @@ Options: -h, --help Show this message. "; -#[derive(Deserialize)] +#[derive(serde::Deserialize)] pub struct Args { cmd_bench: bool, } diff --git a/rayon-demo/src/str_split.rs b/rayon-demo/src/str_split.rs index 249cf0fdd..79fd47bb6 100644 --- a/rayon-demo/src/str_split.rs +++ b/rayon-demo/src/str_split.rs @@ -4,7 +4,7 @@ use rand::seq::SliceRandom; use rayon::prelude::*; use test::Bencher; -lazy_static! { +lazy_static::lazy_static! { static ref HAYSTACK: String = { let mut rng = crate::seeded_rng(); let mut bytes: Vec = "abcdefg ".bytes().cycle().take(1_000_000).collect(); diff --git a/rayon-demo/src/tsp/mod.rs b/rayon-demo/src/tsp/mod.rs index dcb0d2c66..5c0581081 100644 --- a/rayon-demo/src/tsp/mod.rs +++ b/rayon-demo/src/tsp/mod.rs @@ -42,7 +42,7 @@ Options: --from N Node index from which to start the search [default: 0]. "; -#[derive(Deserialize)] +#[derive(serde::Deserialize)] pub struct Args { cmd_bench: bool, arg_datafile: String, diff --git a/rayon-demo/src/tsp/parser.rs b/rayon-demo/src/tsp/parser.rs index e8cf15bb8..10654c510 100644 --- a/rayon-demo/src/tsp/parser.rs +++ b/rayon-demo/src/tsp/parser.rs @@ -23,11 +23,11 @@ use super::weight::Weight; // NODE_COORD_SECTION // 1 11003.611100 42102.500000 -lazy_static! { +lazy_static::lazy_static! { static ref HEADER: Regex = Regex::new(r"([A-Z_]+)\s*:(.*)").unwrap(); } -lazy_static! { +lazy_static::lazy_static! { static ref COORD: Regex = Regex::new(r"([0-9]+) ([0-9.]+) ([0-9.]+)").unwrap(); } diff --git a/src/iter/mod.rs b/src/iter/mod.rs index 21f82f4fd..e07370957 100644 --- a/src/iter/mod.rs +++ b/src/iter/mod.rs @@ -403,9 +403,6 @@ pub trait ParallelIterator: Sized + Send { /// # Examples /// /// ``` - /// extern crate rand; - /// extern crate rayon; - /// /// use rand::Rng; /// use rayon::prelude::*; /// @@ -514,9 +511,6 @@ pub trait ParallelIterator: Sized + Send { /// # Examples /// /// ``` - /// extern crate rand; - /// extern crate rayon; - /// /// use rand::Rng; /// use rayon::prelude::*; /// @@ -636,9 +630,6 @@ pub trait ParallelIterator: Sized + Send { /// # Examples /// /// ``` - /// extern crate rand; - /// extern crate rayon; - /// /// use rand::Rng; /// use rayon::prelude::*; /// diff --git a/src/lib.rs b/src/lib.rs index 630828cec..988d21278 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,8 +39,7 @@ //! //! # Basic usage and the Rayon prelude //! -//! First, you will need to add `rayon` to your `Cargo.toml` and put -//! `extern crate rayon` in your main file (`lib.rs`, `main.rs`). +//! First, you will need to add `rayon` to your `Cargo.toml`. //! //! Next, to use parallel iterators or the other high-level methods, //! you need to import several traits. Those traits are bundled into @@ -84,11 +83,7 @@ //! [faq]: https://github.com/rayon-rs/rayon/blob/master/FAQ.md #[cfg(test)] -#[macro_use] -extern crate doc_comment; - -#[cfg(test)] -doctest!("../README.md"); +doc_comment::doctest!("../README.md"); #[macro_use] mod delegate; diff --git a/tests/sort-panic-safe.rs b/tests/sort-panic-safe.rs index 0461a84f8..7c5050587 100644 --- a/tests/sort-panic-safe.rs +++ b/tests/sort-panic-safe.rs @@ -1,6 +1,3 @@ -#[macro_use] -extern crate lazy_static; - use rand::distributions::Uniform; use rand::{thread_rng, Rng}; use rayon::prelude::*; @@ -13,7 +10,7 @@ use std::thread; static VERSIONS: AtomicUsize = AtomicUsize::new(0); -lazy_static! { +lazy_static::lazy_static! { static ref DROP_COUNTS: Vec = (0..20_000).map(|_| AtomicUsize::new(0)).collect(); } From f7d75532fcbc8151b97dec85131e5a0be3db4b4f Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 19 Dec 2019 12:40:12 -0800 Subject: [PATCH 8/9] Release rayon 1.3.0 / rayon-core 1.7.0 --- Cargo.toml | 4 ++-- RELEASES.md | 37 +++++++++++++++++++++++++++++++++++++ ci/compat-Cargo.lock | 8 ++++---- rayon-core/Cargo.toml | 2 +- rayon-core/src/lib.rs | 2 +- src/lib.rs | 2 +- 6 files changed, 46 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0a1ba44b7..54cfe8f36 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "rayon" # Reminder to update html_rool_url in lib.rs when updating version -version = "1.2.1" +version = "1.3.0" authors = ["Niko Matsakis ", "Josh Stone "] description = "Simple work-stealing parallelism for Rust" @@ -19,7 +19,7 @@ members = ["rayon-demo", "rayon-core"] exclude = ["ci"] [dependencies] -rayon-core = { version = "1.6.1", path = "rayon-core" } +rayon-core = { version = "1.7.0", path = "rayon-core" } crossbeam-deque = "0.7.2" # This is a public dependency! diff --git a/RELEASES.md b/RELEASES.md index 515e817b3..63fae0a87 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,40 @@ +# Release rayon 1.3.0 / rayon-core 1.7.0 (2019-12-20) + +- Tuples up to length 12 now implement `IntoParallelIterator`, creating a + `MultiZip` iterator that produces items as similarly-shaped tuples. +- The `--cfg=rayon_unstable` supporting code for `rayon-futures` is removed. +- The minimum supported `rustc` is now 1.31. + +## Contributors + +Thanks to all of the contributors for this release! + +- @cuviper +- @c410-f3r +- @silwol + + +# Release rayon-futures 0.1.1 (2019-12-20) + +- `Send` bounds have been added for the `Item` and `Error` associated types on + all generic `F: Future` interfaces. While technically a breaking change, this + is a soundness fix, so we are not increasing the semantic version for this. +- This crate is now deprecated, and the `--cfg=rayon_unstable` supporting code + will be removed in `rayon-core 1.7.0`. This only supported the now-obsolete + `Future` from `futures 0.1`, while support for `std::future::Future` is + expected to come directly in `rayon-core` -- although that is not ready yet. + +## Contributors + +Thanks to all of the contributors for this release! + +- @cuviper +- @kornelski +- @jClaireCodesStuff +- @jwass +- @seanchen1991 + + # Release rayon 1.2.1 / rayon-core 1.6.1 (2019-11-20) - Update crossbeam dependencies. diff --git a/ci/compat-Cargo.lock b/ci/compat-Cargo.lock index 1d7f0dae6..3f96a9fe4 100644 --- a/ci/compat-Cargo.lock +++ b/ci/compat-Cargo.lock @@ -831,7 +831,7 @@ dependencies = [ [[package]] name = "rayon" -version = "1.2.1" +version = "1.3.0" dependencies = [ "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "doc-comment 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -840,13 +840,13 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon-core 1.6.1", + "rayon-core 1.7.0", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rayon-core" -version = "1.6.1" +version = "1.7.0" dependencies = [ "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -873,7 +873,7 @@ dependencies = [ "odds 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xorshift 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.2.1", + "rayon 1.3.0", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/rayon-core/Cargo.toml b/rayon-core/Cargo.toml index cdfca8646..79b9b6d76 100644 --- a/rayon-core/Cargo.toml +++ b/rayon-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rayon-core" -version = "1.6.1" # reminder to update html_root_url attribute +version = "1.7.0" # reminder to update html_root_url attribute authors = ["Niko Matsakis ", "Josh Stone "] description = "Core APIs for Rayon" diff --git a/rayon-core/src/lib.rs b/rayon-core/src/lib.rs index eacdb6ca6..0d1488285 100644 --- a/rayon-core/src/lib.rs +++ b/rayon-core/src/lib.rs @@ -19,7 +19,7 @@ //! conflicting requirements will need to be resolved before the build will //! succeed. -#![doc(html_root_url = "https://docs.rs/rayon-core/1.6")] +#![doc(html_root_url = "https://docs.rs/rayon-core/1.7")] #![deny(missing_debug_implementations)] #![deny(missing_docs)] #![deny(unreachable_pub)] diff --git a/src/lib.rs b/src/lib.rs index 988d21278..3cbdacd12 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/rayon/1.2")] +#![doc(html_root_url = "https://docs.rs/rayon/1.3")] #![deny(missing_debug_implementations)] #![deny(missing_docs)] #![deny(unreachable_pub)] From 163003e0e3b3489ee96c6b58ba28983c72f58d91 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 21 Dec 2019 06:56:44 -0800 Subject: [PATCH 9/9] bump the release date --- RELEASES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index 63fae0a87..f752be93b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,4 +1,4 @@ -# Release rayon 1.3.0 / rayon-core 1.7.0 (2019-12-20) +# Release rayon 1.3.0 / rayon-core 1.7.0 (2019-12-21) - Tuples up to length 12 now implement `IntoParallelIterator`, creating a `MultiZip` iterator that produces items as similarly-shaped tuples. @@ -14,7 +14,7 @@ Thanks to all of the contributors for this release! - @silwol -# Release rayon-futures 0.1.1 (2019-12-20) +# Release rayon-futures 0.1.1 (2019-12-21) - `Send` bounds have been added for the `Item` and `Error` associated types on all generic `F: Future` interfaces. While technically a breaking change, this