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 {
19401940 // wait for the child thread to exit before we exit
19411941 rx2. recv ( ) . unwrap ( ) ;
19421942 }
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+ }
19431950}
19441951
19451952#[ 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> {
113113 // Couldn't send the data, the port hung up first. Return the data
114114 // back up the stack.
115115 DISCONNECTED => {
116+ self . state . swap ( DISCONNECTED , Ordering :: SeqCst ) ;
117+ self . upgrade = NothingSent ;
116118 Err ( self . data . take ( ) . unwrap ( ) )
117119 }
118120
You can’t perform that action at this time.
0 commit comments