@@ -40,39 +40,31 @@ fn main() {
40
40
} ;
41
41
42
42
// cancel after we hit the intrinsic and then close the other end
43
- //
44
- // FIXME(wasip3-prototyping#137)
45
- if false {
46
- let ( tx, rx) = wit_future:: new :: < String > ( ) ;
47
- let mut future = Box :: pin ( tx. write ( "hello3" . into ( ) ) ) ;
48
- assert ! ( future
49
- . as_mut( )
50
- . poll( & mut Context :: from_waker( noop_waker_ref( ) ) )
51
- . is_pending( ) ) ;
52
- drop ( rx) ;
53
- match future. as_mut ( ) . cancel ( ) {
54
- FutureWriteCancel :: Closed ( val) => assert_eq ! ( val, "hello3" ) ,
55
- other => panic ! ( "expected closed, got: {other:?}" ) ,
56
- } ;
57
- }
43
+ let ( tx, rx) = wit_future:: new :: < String > ( ) ;
44
+ let mut future = Box :: pin ( tx. write ( "hello3" . into ( ) ) ) ;
45
+ assert ! ( future
46
+ . as_mut( )
47
+ . poll( & mut Context :: from_waker( noop_waker_ref( ) ) )
48
+ . is_pending( ) ) ;
49
+ drop ( rx) ;
50
+ match future. as_mut ( ) . cancel ( ) {
51
+ FutureWriteCancel :: Closed ( val) => assert_eq ! ( val, "hello3" ) ,
52
+ other => panic ! ( "expected closed, got: {other:?}" ) ,
53
+ } ;
58
54
59
55
// Start a write, wait for it to be pending, then go complete the write
60
56
// in some async work, then cancel it and witness that it was written,
61
57
// not cancelled.
62
- //
63
- // FIXME(wasip3-prototyping#138)
64
- if false {
65
- let ( tx, rx) = wit_future:: new :: < String > ( ) ;
66
- let mut future = Box :: pin ( tx. write ( "hello3" . into ( ) ) ) ;
67
- assert ! ( future
68
- . as_mut( )
69
- . poll( & mut Context :: from_waker( noop_waker_ref( ) ) )
70
- . is_pending( ) ) ;
71
- read_and_drop ( rx) . await ;
72
- match future. as_mut ( ) . cancel ( ) {
73
- FutureWriteCancel :: AlreadySent => { }
74
- other => panic ! ( "expected sent, got: {other:?}" ) ,
75
- } ;
76
- }
58
+ let ( tx, rx) = wit_future:: new :: < String > ( ) ;
59
+ let mut future = Box :: pin ( tx. write ( "hello3" . into ( ) ) ) ;
60
+ assert ! ( future
61
+ . as_mut( )
62
+ . poll( & mut Context :: from_waker( noop_waker_ref( ) ) )
63
+ . is_pending( ) ) ;
64
+ read_and_drop ( rx) . await ;
65
+ match future. as_mut ( ) . cancel ( ) {
66
+ FutureWriteCancel :: AlreadySent => { }
67
+ other => panic ! ( "expected sent, got: {other:?}" ) ,
68
+ } ;
77
69
} ) ;
78
70
}
0 commit comments