Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
525: add support of a constant initialization routine r=taiki-e a=stlankes

helps the compiler to pre-compute some quantities

528: Fix clippy warnings r=taiki-e a=taiki-e



Co-authored-by: Stefan Lankes <[email protected]>
Co-authored-by: Taiki Endo <[email protected]>
  • Loading branch information
3 people authored Jun 5, 2020
3 parents 0a1dbee + 5b6d9a7 + 0dafc06 commit bbc8601
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions crossbeam-epoch/src/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ impl<T: ?Sized + Pointable> Pointer<T> for Owned<T> {
unsafe fn from_usize(data: usize) -> Self {
debug_assert!(data != 0, "converting zero into `Owned`");
Owned {
data: data,
data,
_marker: PhantomData,
}
}
Expand Down Expand Up @@ -1085,7 +1085,7 @@ impl<T: ?Sized + Pointable> Pointer<T> for Shared<'_, T> {
#[inline]
unsafe fn from_usize(data: usize) -> Self {
Shared {
data: data,
data,
_marker: PhantomData,
}
}
Expand Down
4 changes: 1 addition & 3 deletions crossbeam-epoch/src/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ impl Bag {
}

impl Default for Bag {
// TODO(taiki-e): when the minimum supported Rust version is bumped to 1.31+,
// replace this with `#[rustfmt::skip]`.
#[cfg_attr(rustfmt, rustfmt_skip)]
#[rustfmt::skip]
fn default() -> Self {
// TODO: [no_op; MAX_OBJECTS] syntax blocked by https://github.com/rust-lang/rust/issues/49147
#[cfg(not(feature = "sanitize"))]
Expand Down
2 changes: 1 addition & 1 deletion crossbeam-epoch/src/sync/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ impl<T> Drop for Queue<T> {
unsafe {
let guard = unprotected();

while let Some(_) = self.try_pop(guard) {}
while self.try_pop(guard).is_some() {}

// Destroy the remaining sentinel node.
let sentinel = self.head.load(Relaxed, guard);
Expand Down
2 changes: 1 addition & 1 deletion crossbeam-utils/src/cache_padded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl<T> CachePadded<T> {
///
/// let padded_value = CachePadded::new(1);
/// ```
pub fn new(t: T) -> CachePadded<T> {
pub const fn new(t: T) -> CachePadded<T> {
CachePadded::<T> { value: t }
}

Expand Down

0 comments on commit bbc8601

Please sign in to comment.