@@ -50,6 +50,7 @@ use core::ptr::NonNull;
5050use core:: sync:: atomic:: AtomicI64 ;
5151use core:: {
5252 cell:: { Cell , OnceCell , RefCell } ,
53+ mem,
5354 sync:: atomic:: { AtomicBool , AtomicU64 , Ordering } ,
5455} ;
5556use crossbeam_utils:: atomic:: AtomicCell ;
@@ -1467,9 +1468,7 @@ impl VirtualMachine {
14671468
14681469 let initial_ptr = self . take_pending_tailcall ( ) ;
14691470 // Drain the refs that keep the initial callee's raw pointers alive.
1470- let initial_refs = unsafe { & mut * self . pending_tailcall_refs . get ( ) }
1471- . drain ( ..)
1472- . collect ( ) ;
1471+ let initial_refs = mem:: take ( unsafe { & mut * self . pending_tailcall_refs . get ( ) } ) ;
14731472 frame_stack. push ( SuspendedFrame {
14741473 iframe : iframe as * mut crate :: frame:: InterpreterFrame ,
14751474 entry_state,
@@ -1498,9 +1497,7 @@ impl VirtualMachine {
14981497 let result = crate :: frame:: run_iframe ( callee, self ) ;
14991498 match result {
15001499 Ok ( ExecutionResult :: TailCall ) => {
1501- let refs = unsafe { & mut * self . pending_tailcall_refs . get ( ) }
1502- . drain ( ..)
1503- . collect ( ) ;
1500+ let refs = mem:: take ( unsafe { & mut * self . pending_tailcall_refs . get ( ) } ) ;
15041501 frame_stack. push ( SuspendedFrame {
15051502 iframe : callee_ptr,
15061503 entry_state : callee_entry,
@@ -1548,9 +1545,7 @@ impl VirtualMachine {
15481545 let result = crate :: frame:: run_iframe ( caller_iframe, self ) ;
15491546 match result {
15501547 Ok ( ExecutionResult :: TailCall ) => {
1551- let refs = unsafe { & mut * self . pending_tailcall_refs . get ( ) }
1552- . drain ( ..)
1553- . collect ( ) ;
1548+ let refs = mem:: take ( unsafe { & mut * self . pending_tailcall_refs . get ( ) } ) ;
15541549 drop ( _caller_refs) ;
15551550 frame_stack. push ( SuspendedFrame {
15561551 iframe : caller_iframe_ptr,
0 commit comments