-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Enable TestMethodsMutating #6215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -582,10 +582,12 @@ impl<T: Clone> Dict<T> { | |||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||
| loop { | ||||||||||||||||||||||||||||
| let index_index = idxs.next(); | ||||||||||||||||||||||||||||
| let index_entry = *unsafe { | ||||||||||||||||||||||||||||
| // Safety: index_index is generated | ||||||||||||||||||||||||||||
| inner.indices.get_unchecked(index_index) | ||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||
| let index_entry_ptr = inner.indices.get(index_index); | ||||||||||||||||||||||||||||
| if index_entry_ptr.is_none() { | ||||||||||||||||||||||||||||
| // Dictionary was modified under our hands, see TestMethodsMutating. | ||||||||||||||||||||||||||||
| continue 'outer; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| let index_entry = *index_entry_ptr.unwrap(); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
| let index_entry_ptr = inner.indices.get(index_index); | |
| if index_entry_ptr.is_none() { | |
| // Dictionary was modified under our hands, see TestMethodsMutating. | |
| continue 'outer; | |
| } | |
| let index_entry = *index_entry_ptr.unwrap(); | |
| let index_entry_ptr = inner.indices.get(index_index); | |
| if index_entry_ptr.is_none() { | |
| // Dictionary was modified under our hands, see TestMethodsMutating. | |
| idxs = None; | |
| continue 'outer; | |
| } | |
| let index_entry = *index_entry_ptr.unwrap(); |
🤖 Prompt for AI Agents
In vm/src/dict_inner.rs around lines 585 to 590, when the
concurrent-modification check finds index_entry_ptr.is_none() you must reset the
cached GenIndexes (idxs) before continuing the 'outer loop so the next iteration
will recreate it with the current mask; modify the branch to clear/take the idxs
(set to None or take ownership) immediately prior to continue 'outer to avoid
reusing a stale mask that causes out-of-bounds indices and an infinite retry
loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would something like this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, done, thank you.