Skip to content

Commit a2eaac6

Browse files
authored
Rollup merge of rust-lang#114965 - benschulz:mpsc-drop, r=dtolnay
Remove Drop impl of mpsc Receiver and (Sync)Sender This change removes the empty `Drop` implementations for `mpsc::Receiver`, `mpsc::Sender` and `mpsc::SyncSender`. These implementations do not specify `#[may_dangle]`, so by removing them we make `mpsc` types play nice with drop check. This was previously attempted in [rust-lang#105243](rust-lang#105243 (comment)) but then [abandoned due to a test failure](rust-lang#105243 (comment)). I've aligned the test with those for `Mutex` and `RwLock`.
2 parents 5d1cda1 + e085cbd commit a2eaac6

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

std/src/sync/mpsc/mod.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -626,11 +626,6 @@ impl<T> Clone for Sender<T> {
626626
}
627627
}
628628

629-
#[stable(feature = "rust1", since = "1.0.0")]
630-
impl<T> Drop for Sender<T> {
631-
fn drop(&mut self) {}
632-
}
633-
634629
#[stable(feature = "mpsc_debug", since = "1.8.0")]
635630
impl<T> fmt::Debug for Sender<T> {
636631
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -755,11 +750,6 @@ impl<T> Clone for SyncSender<T> {
755750
}
756751
}
757752

758-
#[stable(feature = "rust1", since = "1.0.0")]
759-
impl<T> Drop for SyncSender<T> {
760-
fn drop(&mut self) {}
761-
}
762-
763753
#[stable(feature = "mpsc_debug", since = "1.8.0")]
764754
impl<T> fmt::Debug for SyncSender<T> {
765755
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -1096,11 +1086,6 @@ impl<T> IntoIterator for Receiver<T> {
10961086
}
10971087
}
10981088

1099-
#[stable(feature = "rust1", since = "1.0.0")]
1100-
impl<T> Drop for Receiver<T> {
1101-
fn drop(&mut self) {}
1102-
}
1103-
11041089
#[stable(feature = "mpsc_debug", since = "1.8.0")]
11051090
impl<T> fmt::Debug for Receiver<T> {
11061091
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

0 commit comments

Comments
 (0)