File tree 3 files changed +4
-21
lines changed
library/std/src/sync/mpsc
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> {
626
626
}
627
627
}
628
628
629
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
630
- impl < T > Drop for Sender < T > {
631
- fn drop ( & mut self ) { }
632
- }
633
-
634
629
#[ stable( feature = "mpsc_debug" , since = "1.8.0" ) ]
635
630
impl < T > fmt:: Debug for Sender < T > {
636
631
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -755,11 +750,6 @@ impl<T> Clone for SyncSender<T> {
755
750
}
756
751
}
757
752
758
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
759
- impl < T > Drop for SyncSender < T > {
760
- fn drop ( & mut self ) { }
761
- }
762
-
763
753
#[ stable( feature = "mpsc_debug" , since = "1.8.0" ) ]
764
754
impl < T > fmt:: Debug for SyncSender < T > {
765
755
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -1096,11 +1086,6 @@ impl<T> IntoIterator for Receiver<T> {
1096
1086
}
1097
1087
}
1098
1088
1099
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1100
- impl < T > Drop for Receiver < T > {
1101
- fn drop ( & mut self ) { }
1102
- }
1103
-
1104
1089
#[ stable( feature = "mpsc_debug" , since = "1.8.0" ) ]
1105
1090
impl < T > fmt:: Debug for Receiver < T > {
1106
1091
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() {
46
46
tx. send ( & z) . unwrap ( ) ;
47
47
}
48
48
//~^^ 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 )
50
50
}
51
51
52
52
fn main ( ) { }
Original file line number Diff line number Diff line change @@ -75,11 +75,9 @@ LL | tx.send(&z).unwrap();
75
75
| ^^ borrowed value does not live long enough
76
76
LL | }
77
77
| - `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
83
81
84
82
error: aborting due to 6 previous errors
85
83
You can’t perform that action at this time.
0 commit comments