This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +4
-21
lines changed
library/std/src/sync/mpsc Expand file tree Collapse file tree 3 files changed +4
-21
lines changed Original file line number Diff line number Diff 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" ) ]
635630impl < 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" ) ]
764754impl < 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" ) ]
11051090impl < T > fmt:: Debug for Receiver < T > {
11061091 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ fn channel() {
4646 tx. send ( & z) . unwrap ( ) ;
4747 }
4848 //~^^ ERROR `z` does not live long enough
49- // (channels lack #[may_dangle], thus their dtors are implicit uses of `z` )
49+ tx . use_ref ( ) ; // (channel drop glue does not use `z` => needs explicit use )
5050}
5151
5252fn main ( ) { }
Original file line number Diff line number Diff line change @@ -75,11 +75,9 @@ LL | tx.send(&z).unwrap();
7575 | ^^ borrowed value does not live long enough
7676LL | }
7777 | - `z` dropped here while still borrowed
78- ...
79- LL | }
80- | - borrow might be used here, when `tx` is dropped and runs the `Drop` code for type `Sender`
81- |
82- = note: values in a scope are dropped in the opposite order they are defined
78+ LL |
79+ LL | tx.use_ref(); // (channel drop glue does not use `z` => needs explicit use)
80+ | -- borrow later used here
8381
8482error: aborting due to 6 previous errors
8583
You can’t perform that action at this time.
0 commit comments