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: Data flow through variants #18078

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Nov 22, 2024

This PR adds support for tracking data flow through construction and deconstruction of enum variants. For example, we can now identify flow in cases such as

enum MyEnum {
    A(i64),
    B(i64),
}

let s1 = MyEnum::A(source());
match s1 {
    MyEnum::A(n) => sink(n), // flow
    MyEnum::B(n) => sink(n), // no flow
}

Commit-by-commit review is suggested.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Nov 22, 2024
@hvitved hvitved force-pushed the rust/variant-flow branch 2 times, most recently from 02c27dd to 966b0f4 Compare November 25, 2024 09:19
@hvitved hvitved changed the title Rust: Flow through enum constructors Rust: Flow through enum tuple constructors Nov 25, 2024
@hvitved hvitved changed the title Rust: Flow through enum tuple constructors Rust: Flow through variants Nov 25, 2024
@hvitved hvitved force-pushed the rust/variant-flow branch 2 times, most recently from 58c6327 to 4ec9dce Compare November 25, 2024 10:59
@hvitved hvitved marked this pull request as ready for review November 25, 2024 12:06
@hvitved hvitved changed the title Rust: Flow through variants Rust: Data flow through variants Nov 25, 2024
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.

1 participant