Skip to content

Commit

Permalink
CI/clippy: fix CI failure due to rustc upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianion committed Aug 26, 2023
1 parent 2195194 commit 8d5f59b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crossbeam-channel/tests/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ fn recv_in_send() {
#[allow(unreachable_code)]
{
select! {
send(s, panic!()) -> _ => panic!(),
send(s, ()) -> _ => panic!(),
default => {}
}
}
Expand Down
8 changes: 4 additions & 4 deletions crossbeam-channel/tests/select_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::ops::Deref;
use std::thread;
use std::time::{Duration, Instant};

use crossbeam_channel::{after, bounded, never, select, tick, unbounded};
use crossbeam_channel::{after, bounded, select, tick, unbounded};
use crossbeam_channel::{Receiver, RecvError, SendError, Sender, TryRecvError};
use crossbeam_utils::thread::scope;

Expand Down Expand Up @@ -467,7 +467,7 @@ fn panic_sender() {
#[allow(unreachable_code)]
{
select! {
send(get(), panic!()) -> _ => {}
send(get(), 0) -> _ => {}
}
}
}
Expand Down Expand Up @@ -956,11 +956,11 @@ fn references() {
recv(&&&&r) -> _ => {}
}
select! {
recv(Some(&r).unwrap_or(&never())) -> _ => {},
recv(&r) -> _ => {},
default => {}
}
select! {
recv(Some(r).unwrap_or(never())) -> _ => {},
recv(r) -> _ => {},
default => {}
}
}
Expand Down
8 changes: 4 additions & 4 deletions crossbeam-epoch/src/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ use core::fmt;

use crate::guard::Guard;
use crate::internal::{Global, Local};
use crate::primitive::sync::Arc;
use crate::primitive::sync::Rc;

/// An epoch-based garbage collector.
pub struct Collector {
pub(crate) global: Arc<Global>,
pub(crate) global: Rc<Global>,
}

unsafe impl Send for Collector {}
Expand All @@ -29,7 +29,7 @@ unsafe impl Sync for Collector {}
impl Default for Collector {
fn default() -> Self {
Self {
global: Arc::new(Global::new()),
global: Rc::new(Global::new()),
}
}
}
Expand Down Expand Up @@ -64,7 +64,7 @@ impl fmt::Debug for Collector {
impl PartialEq for Collector {
/// Checks if both handles point to the same collector.
fn eq(&self, rhs: &Collector) -> bool {
Arc::ptr_eq(&self.global, &rhs.global)
Rc::ptr_eq(&self.global, &rhs.global)
}
}
impl Eq for Collector {}
Expand Down
2 changes: 2 additions & 0 deletions crossbeam-epoch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ mod primitive {
pub(crate) use core::sync::atomic::{compiler_fence, fence, AtomicPtr, AtomicUsize};
}
#[cfg(feature = "alloc")]
pub(crate) use alloc::rc::Rc;
#[cfg(feature = "alloc")]
pub(crate) use alloc::sync::Arc;
}

Expand Down

0 comments on commit 8d5f59b

Please sign in to comment.