Remove Drop impl of mpsc Receiver and (Sync)Sender
This commit is contained in:
parent
0f7f6b7061
commit
a38ea96825
library/std/src/sync/mpsc
tests/ui/span
@ -626,11 +626,6 @@ impl<T> Clone for Sender<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
|
||||||
impl<T> Drop for Sender<T> {
|
|
||||||
fn drop(&mut self) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[stable(feature = "mpsc_debug", since = "1.8.0")]
|
#[stable(feature = "mpsc_debug", since = "1.8.0")]
|
||||||
impl<T> fmt::Debug for Sender<T> {
|
impl<T> fmt::Debug for Sender<T> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
@ -755,11 +750,6 @@ impl<T> Clone for SyncSender<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
|
||||||
impl<T> Drop for SyncSender<T> {
|
|
||||||
fn drop(&mut self) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[stable(feature = "mpsc_debug", since = "1.8.0")]
|
#[stable(feature = "mpsc_debug", since = "1.8.0")]
|
||||||
impl<T> fmt::Debug for SyncSender<T> {
|
impl<T> fmt::Debug for SyncSender<T> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
@ -1096,11 +1086,6 @@ impl<T> IntoIterator for Receiver<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
|
||||||
impl<T> Drop for Receiver<T> {
|
|
||||||
fn drop(&mut self) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[stable(feature = "mpsc_debug", since = "1.8.0")]
|
#[stable(feature = "mpsc_debug", since = "1.8.0")]
|
||||||
impl<T> fmt::Debug for Receiver<T> {
|
impl<T> fmt::Debug for Receiver<T> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
@ -46,7 +46,7 @@ fn channel() {
|
|||||||
tx.send(&z).unwrap();
|
tx.send(&z).unwrap();
|
||||||
}
|
}
|
||||||
//~^^ ERROR `z` does not live long enough
|
//~^^ ERROR `z` does not live long enough
|
||||||
// (channels lack #[may_dangle], thus their dtors are implicit uses of `z`)
|
tx.use_ref(); // (channel drop glue does not use `z` => needs explicit use)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
@ -75,11 +75,9 @@ LL | tx.send(&z).unwrap();
|
|||||||
| ^^ borrowed value does not live long enough
|
| ^^ borrowed value does not live long enough
|
||||||
LL | }
|
LL | }
|
||||||
| - `z` dropped here while still borrowed
|
| - `z` dropped here while still borrowed
|
||||||
...
|
LL |
|
||||||
LL | }
|
LL | tx.use_ref(); // (channel drop glue does not use `z` => needs explicit use)
|
||||||
| - borrow might be used here, when `tx` is dropped and runs the `Drop` code for type `Sender`
|
| -- borrow later used here
|
||||||
|
|
|
||||||
= note: values in a scope are dropped in the opposite order they are defined
|
|
||||||
|
|
||||||
error: aborting due to 6 previous errors
|
error: aborting due to 6 previous errors
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user