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

fix(engine) Fix question marks simplification with deref/borrow. #1305

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

maximebuyse
Copy link
Contributor

Fixes #1299

The problem is that in this case we have a match branch:

core::ops::control_flow::ControlFlow_Continue(val) => {
    &(deref(val))
}

and the phase expects the usual:

core::ops::control_flow::ControlFlow_Continue(val) => {
    val
}

I tried moving Simplify_question_marks after Drop_references, but this means moving it after Direct_and_mut which also messes with the pattern needed to be recognized for question marks...

@maximebuyse maximebuyse requested a review from a team as a code owner February 10, 2025 14:57
@maximebuyse maximebuyse self-assigned this Feb 10, 2025
Copy link
Collaborator

@W95Psp W95Psp left a comment

Choose a reason for hiding this comment

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

Thanks! I think making the pattern more flexible is the way to go.

@W95Psp W95Psp added this pull request to the merge queue Feb 10, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Feb 10, 2025
@maximebuyse maximebuyse added this pull request to the merge queue Feb 10, 2025
Merged via the queue into main with commit 1e29d8c Feb 10, 2025
15 checks passed
@maximebuyse maximebuyse deleted the fix-1299 branch February 10, 2025 18:15
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.

Deep question mark not reconstructed
2 participants