Skip to content

Commit 1f9d117

Browse files
committed
Remove cfg(rayon_unstable)
1 parent 198ca7f commit 1f9d117

File tree

11 files changed

+3
-396
lines changed

11 files changed

+3
-396
lines changed

.travis.yml

+2-22
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ matrix:
99
fast_finish: true
1010
include:
1111
# NB: To help with CI delays, each `pull_request` is only tested on Linux,
12-
# with 1.31 for compatibility and stable+rayon_unstable for broad test
13-
# coverage. The bors bot counts as a `push` type, which will run it all.
12+
# with 1.31 for compatibility and stable for broad test coverage. The bors
13+
# bot counts as a `push` type, which will run it all.
1414

1515
- rust: 1.31.0
1616
os: linux
@@ -20,43 +20,23 @@ matrix:
2020

2121
- rust: stable
2222
os: linux
23-
if: NOT type = pull_request
24-
- rust: stable
25-
os: linux
26-
env: RUSTFLAGS='--cfg rayon_unstable'
2723
#if: everything!
2824

2925
- rust: beta
3026
os: linux
3127
if: NOT type = pull_request
32-
- rust: beta
33-
os: linux
34-
env: RUSTFLAGS='--cfg rayon_unstable'
35-
if: NOT type = pull_request
3628

3729
- rust: nightly
3830
os: linux
3931
if: NOT type = pull_request
40-
- rust: nightly
41-
os: linux
42-
env: RUSTFLAGS='--cfg rayon_unstable'
43-
if: NOT type = pull_request
4432

4533
- rust: stable
4634
os: osx
4735
if: NOT type = pull_request
48-
- rust: stable
49-
os: osx
50-
env: RUSTFLAGS='--cfg rayon_unstable'
51-
if: NOT type = pull_request
5236

5337
- rust: nightly
5438
os: osx
5539
if: NOT type = pull_request
56-
- rust: nightly
57-
os: osx
58-
env: RUSTFLAGS='--cfg rayon_unstable'
59-
if: NOT type = pull_request
6040

6141
# wasm won't actually work without threading, but it builds
6242
- rust: nightly

appveyor.yml

-7
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,8 @@ environment:
33
matrix:
44
- TARGET: x86_64-pc-windows-gnu
55
CHANNEL: stable
6-
- TARGET: x86_64-pc-windows-gnu
7-
CHANNEL: stable
8-
RUSTFLAGS: --cfg rayon_unstable
9-
10-
- TARGET: x86_64-pc-windows-msvc
11-
CHANNEL: stable
126
- TARGET: x86_64-pc-windows-msvc
137
CHANNEL: stable
14-
RUSTFLAGS: --cfg rayon_unstable
158

169
install:
1710
- curl -sSf -o rustup-init.exe https://win.rustup.rs

rayon-core/src/internal/mod.rs

-8
This file was deleted.

rayon-core/src/internal/task.rs

-83
This file was deleted.

rayon-core/src/internal/worker.rs

-67
This file was deleted.

rayon-core/src/lib.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use std::io;
3232
use std::marker::PhantomData;
3333
use std::str::FromStr;
3434

35-
#[cfg(any(debug_assertions, rayon_unstable))]
35+
#[cfg(any(debug_assertions))]
3636
#[macro_use]
3737
extern crate lazy_static;
3838

@@ -55,9 +55,6 @@ mod util;
5555
mod compile_fail;
5656
mod test;
5757

58-
#[cfg(rayon_unstable)]
59-
pub mod internal;
60-
6158
pub use self::join::{join, join_context};
6259
pub use self::registry::ThreadBuilder;
6360
pub use self::scope::{scope, Scope};

rayon-core/src/registry.rs

-56
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
use crossbeam_deque::{Steal, Stealer, Worker};
22
use crossbeam_queue::SegQueue;
3-
#[cfg(rayon_unstable)]
4-
use crate::internal::task::Task;
5-
#[cfg(rayon_unstable)]
6-
use crate::job::Job;
73
use crate::job::{JobFifo, JobRef, StackJob};
84
use crate::latch::{CountLatch, Latch, LatchProbe, LockLatch, SpinLatch, TickleLatch};
95
use crate::log::Event::*;
@@ -267,11 +263,6 @@ impl Registry {
267263
Ok(registry.clone())
268264
}
269265

270-
#[cfg(rayon_unstable)]
271-
pub(super) fn global() -> Arc<Registry> {
272-
global_registry().clone()
273-
}
274-
275266
pub(super) fn current() -> Arc<Registry> {
276267
unsafe {
277268
let worker_thread = WorkerThread::current();
@@ -377,53 +368,6 @@ impl Registry {
377368
}
378369
}
379370

380-
/// Unsafe: the caller must guarantee that `task` will stay valid
381-
/// until it executes.
382-
#[cfg(rayon_unstable)]
383-
pub(super) unsafe fn submit_task<T>(&self, task: Arc<T>)
384-
where
385-
T: Task,
386-
{
387-
let task_job = TaskJob::new(task);
388-
let task_job_ref = TaskJob::into_job_ref(task_job);
389-
return self.inject_or_push(task_job_ref);
390-
391-
/// A little newtype wrapper for `T`, just because I did not
392-
/// want to implement `Job` for all `T: Task`.
393-
struct TaskJob<T: Task> {
394-
_data: T,
395-
}
396-
397-
impl<T: Task> TaskJob<T> {
398-
fn new(arc: Arc<T>) -> Arc<Self> {
399-
// `TaskJob<T>` has the same layout as `T`, so we can safely
400-
// tranmsute this `T` into a `TaskJob<T>`. This lets us write our
401-
// impls of `Job` for `TaskJob<T>`, making them more restricted.
402-
// Since `Job` is a private trait, this is not strictly necessary,
403-
// I don't think, but makes me feel better.
404-
unsafe { mem::transmute(arc) }
405-
}
406-
407-
fn into_task(this: Arc<TaskJob<T>>) -> Arc<T> {
408-
// Same logic as `new()`
409-
unsafe { mem::transmute(this) }
410-
}
411-
412-
unsafe fn into_job_ref(this: Arc<Self>) -> JobRef {
413-
let this: *const Self = mem::transmute(this);
414-
JobRef::new(this)
415-
}
416-
}
417-
418-
impl<T: Task> Job for TaskJob<T> {
419-
unsafe fn execute(this: *const Self) {
420-
let this: Arc<Self> = mem::transmute(this);
421-
let task: Arc<T> = TaskJob::into_task(this);
422-
Task::execute(task);
423-
}
424-
}
425-
}
426-
427371
/// Push a job into the "external jobs" queue; it will be taken by
428372
/// whatever worker has nothing to do. Use this is you know that
429373
/// you are not on a worker of this registry.

rayon-core/src/scope/internal.rs

-61
This file was deleted.

rayon-core/src/scope/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use std::sync::atomic::{AtomicPtr, Ordering};
1717
use std::sync::Arc;
1818
use crate::unwind;
1919

20-
mod internal;
2120
#[cfg(test)]
2221
mod test;
2322

0 commit comments

Comments
 (0)