Skip to content

Rust: Add more CFG tests #17626

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

Merged
merged 1 commit into from
Sep 30, 2024
Merged

Rust: Add more CFG tests #17626

merged 1 commit into from
Sep 30, 2024

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Sep 30, 2024

Adds a bunch of test cases for functions with incorrect CFGs.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Sep 30, 2024
@hvitved hvitved marked this pull request as ready for review September 30, 2024 13:18
@@ -64,18 +64,18 @@ predicate trivialPat(Pat p) { p instanceof WildcardPat or p instanceof IdentPat
class AsmExprTree extends LeafTree instanceof AsmExpr { }

class AwaitExprTree extends StandardPostOrderTree instanceof AwaitExpr {
override ControlFlowTree getChildNode(int i) { i = 0 and result = super.getExpr() }
override AstNode getChildNode(int i) { i = 0 and result = super.getExpr() }
Copy link
Contributor

Choose a reason for hiding this comment

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

Why these changes? I don't think they're bad, just wondering why they were made in a commit with title Rust: Add more CFG tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without this change we do not get the dead-end inconsistency for the while loop test, because WhileExpr is not (yet) a ControlFlowTree.

@hvitved hvitved merged commit 3a210b7 into github:main Sep 30, 2024
13 of 14 checks passed
@hvitved hvitved deleted the rust/more-cfg-tests branch September 30, 2024 13:38
@aibaars
Copy link
Contributor

aibaars commented Sep 30, 2024

@hvitved Why did you merge this into main? The Rust Language Tests Linux job failed.

@hvitved
Copy link
Contributor Author

hvitved commented Sep 30, 2024

Why did you merge this into main? The Rust Language Tests Linux job failed.

D'oh, sorry. I merged on mobile; didn't see the CI failure. Fix here: #17627.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants