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

Rust: Handle early returns in async blocks in CFG #18024

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Nov 19, 2024

Fixes CFG deadEnd inconsistencies.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Nov 19, 2024

mod if_expression {

fn test_and_if_let(a: bool, b: Option<bool>, c: bool) -> bool {

Check notice

Code scanning / CodeQL

Unused variable Note test

Variable 'c' is not used.
mod if_expression {

fn test_and_if_let(a: bool, b: Option<bool>, c: bool) -> bool {
if a && let Some(d) = b {

Check notice

Code scanning / CodeQL

Unused variable Note test

Variable 'd' is not used.
}

fn test_and_if_let2(a: bool, b: i64, c: bool) -> bool {
if a && let d = b

Check notice

Code scanning / CodeQL

Unused variable Note test

Variable 'd' is not used.
@hvitved hvitved marked this pull request as ready for review November 19, 2024 09:50
Copy link
Contributor

@paldepind paldepind left a comment

Choose a reason for hiding this comment

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

Change looks good to me.

DCA report shows that the recently introduced inconsistencies have been fixed.

@hvitved hvitved merged commit 7a06574 into github:main Nov 19, 2024
15 checks passed
@hvitved hvitved deleted the rust/cfg/async-block-return branch November 19, 2024 14:21
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