Using stable iteration order for user_provided_types writeback#151949
Using stable iteration order for user_provided_types writeback#151949paradoxicalguy wants to merge 2 commits intorust-lang:mainfrom
Conversation
|
🤔 user type annotations are stored in an Also, judging by the CI failure that prompted it, the problem in #73501 looks like |
|
I agree with dianne's analysis |
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
|
thanks for the feedback @dianne |
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
fixes issue #73501
this PR fixes a source of MIR non-determinism described in issue #73501 by applying a stable iteration order when writing
user_provided_typesfrom the function context intoTypechResultsduring writeback phase.previously these entries were done by using
.extend()onuser_provided_types, an unstable iteration order leading toDefIddrift because of randomness causing MIR differences between local runs and CI,switching to
items_in_stable_order()ensures deterministic insertion without changing semantics because it sorts items byItemLocalIdbefore inserting them.tests ran:
./x.py test tests/mir-optnow produces a stable result across repeated runs