@@ -6,8 +6,8 @@ use super::objiter;
66use super :: objstr;
77use super :: objtype;
88use crate :: pyobject:: {
9- PyAttributes , PyContext , PyFuncArgs , PyObject , PyObjectPayload , PyObjectPayload2 , PyObjectRef ,
10- PyResult , TypeProtocol ,
9+ PyAttributes , PyContext , PyFuncArgs , PyIteratorValue , PyObject , PyObjectPayload ,
10+ PyObjectPayload2 , PyObjectRef , PyResult , TypeProtocol ,
1111} ;
1212use crate :: vm:: { ReprGuard , VirtualMachine } ;
1313
@@ -249,9 +249,11 @@ fn dict_iter(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
249249 let key_list = vm. ctx . new_list ( keys) ;
250250
251251 let iter_obj = PyObject :: new (
252- PyObjectPayload :: Iterator {
253- position : Cell :: new ( 0 ) ,
254- iterated_obj : key_list,
252+ PyObjectPayload :: AnyRustValue {
253+ value : Box :: new ( PyIteratorValue {
254+ position : Cell :: new ( 0 ) ,
255+ iterated_obj : key_list,
256+ } ) ,
255257 } ,
256258 vm. ctx . iter_type ( ) ,
257259 ) ;
@@ -269,9 +271,11 @@ fn dict_values(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
269271 let values_list = vm. ctx . new_list ( values) ;
270272
271273 let iter_obj = PyObject :: new (
272- PyObjectPayload :: Iterator {
273- position : Cell :: new ( 0 ) ,
274- iterated_obj : values_list,
274+ PyObjectPayload :: AnyRustValue {
275+ value : Box :: new ( PyIteratorValue {
276+ position : Cell :: new ( 0 ) ,
277+ iterated_obj : values_list,
278+ } ) ,
275279 } ,
276280 vm. ctx . iter_type ( ) ,
277281 ) ;
@@ -289,9 +293,11 @@ fn dict_items(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
289293 let items_list = vm. ctx . new_list ( items) ;
290294
291295 let iter_obj = PyObject :: new (
292- PyObjectPayload :: Iterator {
293- position : Cell :: new ( 0 ) ,
294- iterated_obj : items_list,
296+ PyObjectPayload :: AnyRustValue {
297+ value : Box :: new ( PyIteratorValue {
298+ position : Cell :: new ( 0 ) ,
299+ iterated_obj : items_list,
300+ } ) ,
295301 } ,
296302 vm. ctx . iter_type ( ) ,
297303 ) ;
0 commit comments