Skip to content

Commit

Permalink
Merge #777
Browse files Browse the repository at this point in the history
777: Fix a few minor warnings r=cuviper a=cuviper



Co-authored-by: Josh Stone <[email protected]>
  • Loading branch information
bors[bot] and cuviper authored Jul 16, 2020
2 parents f0d2e70 + 2e57052 commit d3e32be
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.40.0
toolchain: 1.45.0
override: true
components: rustfmt
- name: Check formatting
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.40.0
toolchain: 1.45.0
override: true
components: rustfmt
- name: Check formatting
Expand Down
1 change: 1 addition & 0 deletions rayon-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#![deny(missing_debug_implementations)]
#![deny(missing_docs)]
#![deny(unreachable_pub)]
#![warn(rust_2018_idioms)]

use std::any::Any;
use std::env;
Expand Down
4 changes: 2 additions & 2 deletions rayon-core/src/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ macro_rules! private_decl {
/// impossible to implement outside the crate.
#[doc(hidden)]
fn __rayon_private__(&self) -> crate::private::PrivateMarker;
}
};
}

macro_rules! private_impl {
() => {
fn __rayon_private__(&self) -> crate::private::PrivateMarker {
crate::private::PrivateMarker
}
}
};
}
12 changes: 6 additions & 6 deletions rayon-core/src/sleep/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl Sleep {
pub(super) fn work_found(&self, worker_index: usize, yields: usize) -> usize {
log!(FoundWork {
worker: worker_index,
yields: yields,
yields,
});
if yields > ROUNDS_UNTIL_SLEEPY {
// FIXME tickling here is a bit extreme; mostly we want to "release the lock"
Expand All @@ -64,7 +64,7 @@ impl Sleep {
pub(super) fn no_work_found(&self, worker_index: usize, yields: usize) -> usize {
log!(DidNotFindWork {
worker: worker_index,
yields: yields,
yields,
});
if yields < ROUNDS_UNTIL_SLEEPY {
thread::yield_now();
Expand Down Expand Up @@ -119,7 +119,7 @@ impl Sleep {
let old_state = self.state.swap(AWAKE, Ordering::Release);
log!(Tickle {
worker: worker_index,
old_state: old_state,
old_state,
});
if self.anyone_sleeping(old_state) {
let _data = self.data.lock().unwrap();
Expand All @@ -138,7 +138,7 @@ impl Sleep {
let state = self.state.load(Ordering::Acquire);
log!(GetSleepy {
worker: worker_index,
state: state,
state,
});
if self.any_worker_is_sleepy(state) {
// somebody else is already sleepy, so we'll just wait our turn
Expand Down Expand Up @@ -175,7 +175,7 @@ impl Sleep {
log!(GotSleepy {
worker: worker_index,
old_state: state,
new_state: new_state,
new_state,
});
return true;
}
Expand Down Expand Up @@ -264,7 +264,7 @@ impl Sleep {
log!(FellAsleep {
worker: worker_index
});
let _ = self.tickle.wait(data).unwrap();
drop(self.tickle.wait(data).unwrap());
log!(GotAwoken {
worker: worker_index
});
Expand Down
1 change: 1 addition & 0 deletions rayon-demo/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![cfg_attr(test, feature(test))]
#![warn(rust_2018_idioms)]

use std::env;
use std::io;
Expand Down
2 changes: 1 addition & 1 deletion src/iter/collect/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl<'c, T: Send + 'c> Collect<'c, T> {
/// the vector is complete with the collected result.
fn with_consumer<F>(mut self, scope_fn: F)
where
F: FnOnce(CollectConsumer<T>) -> CollectResult<T>,
F: FnOnce(CollectConsumer<'_, T>) -> CollectResult<'_, T>,
{
unsafe {
let slice = Self::reserve_get_tail_slice(&mut self.vec, self.len);
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#![deny(missing_debug_implementations)]
#![deny(missing_docs)]
#![deny(unreachable_pub)]
#![warn(rust_2018_idioms)]

//! Data-parallelism library that makes it easy to convert sequential
//! computations into parallel
Expand Down
4 changes: 2 additions & 2 deletions src/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ macro_rules! private_decl {
/// impossible to implement outside the crate.
#[doc(hidden)]
fn __rayon_private__(&self) -> crate::private::PrivateMarker;
}
};
}

macro_rules! private_impl {
() => {
fn __rayon_private__(&self) -> crate::private::PrivateMarker {
crate::private::PrivateMarker
}
}
};
}
4 changes: 2 additions & 2 deletions src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub trait ParallelSlice<T: Sync> {
let len = slice.len() - rem;
let (fst, snd) = slice.split_at(len);
ChunksExact {
chunk_size: chunk_size,
chunk_size,
slice: fst,
rem: snd,
}
Expand Down Expand Up @@ -199,7 +199,7 @@ pub trait ParallelSliceMut<T: Send> {
let len = slice.len() - rem;
let (fst, snd) = slice.split_at_mut(len);
ChunksExactMut {
chunk_size: chunk_size,
chunk_size,
slice: fst,
rem: snd,
}
Expand Down

0 comments on commit d3e32be

Please sign in to comment.