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

support let-else statement for CFG #10215

Merged
merged 1 commit into from Mar 8, 2023
Merged

support let-else statement for CFG #10215

merged 1 commit into from Mar 8, 2023

Conversation

White-Green
Copy link
Contributor

@White-Green White-Green commented Mar 7, 2023

fix: #9681 (cc: @ortem)
Follow-up for #7798

This pull request addresses issue #9681 by correctly handling the else block of let-else statements in the construction of the ControlFlowGraph.

Due to issues with my environment, not all tests could be executed. I apologize if any failures occurred.

changelog: Fix false-positive detection of unreachable code with let else syntax

@artemmukhin artemmukhin self-assigned this Mar 7, 2023
@artemmukhin
Copy link
Member

@White-Green Thank you, and welcome to IntelliJ Rust! As a first-time contributor, you can add your username to CONTRIBUTORS.txt file.

Could you please clarify what kind of issue you have with tests? Maybe we can help. Also, CONTRIBUTING.md file might help to learn more about the project setup.

@artemmukhin artemmukhin added the fix Pull requests that fix some bug(s) label Mar 7, 2023
@artemmukhin artemmukhin added this to In Progress in To test via automation Mar 7, 2023
Copy link
Member

@artemmukhin artemmukhin left a comment

Choose a reason for hiding this comment

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

Please handle let-else syntax in org.rust.lang.core.dfa.ExprUseWalker#walkLet and add the corresponding test cases to RsUnreachableCodeInspectionTest

@Undin
Copy link
Member

Undin commented Mar 8, 2023

As a first-time contributor, you can add your username to CONTRIBUTORS.txt file.

Note, we don't collect contributors' usernames anymore since we don't need to check CLA

@White-Green
Copy link
Contributor Author

@ortem Thank you for pointing out the missing.
I fixed it.

Copy link
Member

@artemmukhin artemmukhin left a comment

Choose a reason for hiding this comment

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

LGTM, just one minor comment.
Before we merge it, please squash your commits into one and force-push it

src/main/kotlin/org/rust/lang/core/dfa/ExprUseWalker.kt Outdated Show resolved Hide resolved
@artemmukhin
Copy link
Member

@White-Green Thank you again, and welcome to IntelliJ Rust contributors!

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 8, 2023

Build succeeded:

@bors bors bot merged commit 9a68e20 into intellij-rust:master Mar 8, 2023
To test automation moved this from In Progress to Test Mar 8, 2023
@github-actions github-actions bot added this to the v191 milestone Mar 8, 2023
@mili-l mili-l self-assigned this Mar 10, 2023
@mili-l mili-l moved this from Test to Done in To test Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull requests that fix some bug(s)
Projects
To test
  
Done
Development

Successfully merging this pull request may close these issues.

False-positive: unreachable code with let-else statement
4 participants