File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1940,6 +1940,13 @@ mod tests {
1940
1940
// wait for the child thread to exit before we exit
1941
1941
rx2. recv ( ) . unwrap ( ) ;
1942
1942
}
1943
+
1944
+ #[ test]
1945
+ fn issue_32114 ( ) {
1946
+ let ( tx, _) = channel ( ) ;
1947
+ let _ = tx. send ( 123 ) ;
1948
+ assert_eq ! ( tx. send( 123 ) , Err ( SendError ( 123 ) ) ) ;
1949
+ }
1943
1950
}
1944
1951
1945
1952
#[ cfg( all( test, not( target_os = "emscripten" ) ) ) ]
Original file line number Diff line number Diff line change @@ -113,6 +113,8 @@ impl<T> Packet<T> {
113
113
// Couldn't send the data, the port hung up first. Return the data
114
114
// back up the stack.
115
115
DISCONNECTED => {
116
+ self . state . swap ( DISCONNECTED , Ordering :: SeqCst ) ;
117
+ self . upgrade = NothingSent ;
116
118
Err ( self . data . take ( ) . unwrap ( ) )
117
119
}
118
120
You can’t perform that action at this time.
0 commit comments