Skip to content

Commit

Permalink
Merge #431
Browse files Browse the repository at this point in the history
431: Remove #[allow(unsafe_code)] from select! macro r=taiki-e a=taiki-e

Replaces #430 

Closes #405 

Co-authored-by: Taiki Endo <te316e89@gmail.com>
  • Loading branch information
bors[bot] and taiki-e committed May 20, 2020
2 parents 321110b + caa8802 commit 5f3be95
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions crossbeam-channel/src/select_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,6 @@ macro_rules! crossbeam_channel_internal {
let _oper = $crate::internal::select(&mut $sel);

// Erase the lifetime so that `sel` can be dropped early even without NLL.
#[allow(unsafe_code)]
unsafe { ::std::mem::transmute(_oper) }
};

Expand All @@ -852,7 +851,6 @@ macro_rules! crossbeam_channel_internal {
let _oper = $crate::internal::try_select(&mut $sel);

// Erase the lifetime so that `sel` can be dropped early even without NLL.
#[allow(unsafe_code)]
unsafe { ::std::mem::transmute(_oper) }
};

Expand Down Expand Up @@ -883,7 +881,6 @@ macro_rules! crossbeam_channel_internal {
let _oper = $crate::internal::select_timeout(&mut $sel, $timeout);

// Erase the lifetime so that `sel` can be dropped early even without NLL.
#[allow(unsafe_code)]
unsafe { ::std::mem::transmute(_oper) }
};

Expand Down Expand Up @@ -922,7 +919,6 @@ macro_rules! crossbeam_channel_internal {
) => {{
match $r {
ref _r => {
#[allow(unsafe_code)]
let $var: &$crate::Receiver<_> = unsafe {
let _r: &$crate::Receiver<_> = _r;

Expand Down Expand Up @@ -955,7 +951,6 @@ macro_rules! crossbeam_channel_internal {
) => {{
match $s {
ref _s => {
#[allow(unsafe_code)]
let $var: &$crate::Sender<_> = unsafe {
let _s: &$crate::Sender<_> = _s;

Expand Down
2 changes: 1 addition & 1 deletion crossbeam-channel/tests/select_macro.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Tests for the `select!` macro.

#![deny(unsafe_code)]
#![forbid(unsafe_code)] // select! is safe.

#[macro_use]
extern crate crossbeam_channel;
Expand Down

0 comments on commit 5f3be95

Please sign in to comment.