Skip to content
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

fixed lowering struct-construct so member lowering order is the same … #4947

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

TomerStarkware
Copy link
Collaborator

@TomerStarkware TomerStarkware commented Jan 29, 2024

…as in the user code


This change is Reviewable

@TomerStarkware TomerStarkware requested a review from orizi January 29, 2024 09:48
Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @TomerStarkware)


crates/cairo-lang-lowering/src/lower/mod.rs line 2424 at r1 (raw file):

                }
            }
        }

Suggestion:

        for (base_member, (_, member)) in izip!(
            StructDestructure {
                input: base_struct_usage.var_id,
                var_reqs: members
                    .iter()
                    .map(|(_, member)| VarRequest { ty: member.ty, location })
                    .collect(),
            }.add(ctx, &mut builder.statements),
            &members
        ) {
            match member_expr_usages.entry(member.id) {
                Entry::Occupied(_) => {}
                Entry::Vacant(entry) => {
                    entry.insert(Ok(VarUsage {
                        var_id: base_member,
                        location,
                    }));
                }
            }
        }

@TomerStarkware TomerStarkware force-pushed the tomer/fix_structconstruct_order branch from 547670a to ff9ba39 Compare January 29, 2024 11:13
Copy link
Collaborator Author

@TomerStarkware TomerStarkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @orizi)


crates/cairo-lang-lowering/src/lower/mod.rs line 2424 at r1 (raw file):

                }
            }
        }

Done.

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @TomerStarkware)

@TomerStarkware TomerStarkware added this pull request to the merge queue Jan 29, 2024
Merged via the queue into main with commit 24e5b45 Jan 29, 2024
41 checks passed
@orizi orizi deleted the tomer/fix_structconstruct_order branch February 4, 2024 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants