File tree Expand file tree Collapse file tree 2 files changed +0
-28
lines changed Expand file tree Collapse file tree 2 files changed +0
-28
lines changed Original file line number Diff line number Diff line change 1
1
#![ feature( generators, generator_trait, never_type) ]
2
2
3
- use std:: panic:: { catch_unwind, AssertUnwindSafe } ;
4
3
use std:: ops:: { GeneratorState :: { self , * } , Generator } ;
5
4
use std:: pin:: Pin ;
6
5
use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
@@ -183,33 +182,7 @@ fn smoke_resume_arg() {
183
182
} ) ;
184
183
}
185
184
186
- fn panic_drop_resume ( ) {
187
- static DROP : AtomicUsize = AtomicUsize :: new ( 0 ) ;
188
-
189
- struct Dropper { }
190
-
191
- impl Drop for Dropper {
192
- fn drop ( & mut self ) {
193
- DROP . fetch_add ( 1 , Ordering :: SeqCst ) ;
194
- }
195
- }
196
-
197
- let mut gen = |_arg| {
198
- if true {
199
- panic ! ( ) ;
200
- }
201
- yield ( ) ;
202
- } ;
203
- let mut gen = Pin :: new ( & mut gen) ;
204
-
205
- assert_eq ! ( DROP . load( Ordering :: Acquire ) , 0 ) ;
206
- let res = catch_unwind ( AssertUnwindSafe ( || gen. as_mut ( ) . resume ( Dropper { } ) ) ) ;
207
- assert ! ( res. is_err( ) ) ;
208
- assert_eq ! ( DROP . load( Ordering :: Acquire ) , 1 ) ;
209
- }
210
-
211
185
fn main ( ) {
212
186
basic ( ) ;
213
187
smoke_resume_arg ( ) ;
214
- panic_drop_resume ( ) ;
215
188
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments