Skip to content

Tiny readability cleanups for initialization dataflow analyses - #160995

Open
lqd wants to merge 3 commits into
rust-lang:mainfrom
lqd:readabilly
Open

Tiny readability cleanups for initialization dataflow analyses#160995
lqd wants to merge 3 commits into
rust-lang:mainfrom
lqd:readabilly

Conversation

@lqd

@lqd lqd commented Aug 12, 2026

Copy link
Copy Markdown
Member

While reading over borrowck liveness, I noticed this handful of small things in the dataflow initialization module.

They're easier to see per-commit but:

  • each analysis code was hard to read and locate, as the impls were scattered over the file, so this regroups them
  • some of these didn't follow the pattern others did
  • we were asserting things we didn't use, and which were already guaranteed by the function we were calling

r? @jackh726

lqd added 3 commits August 12, 2026 18:17
to help readability, regroup all the impls for each analysis
together, instead of randomly scattering them in the module.
some analysis impls didn't follow the patterns that all others did:
- only constructors need to specify 'a
- the functions that don't need 'a are grouped in their own impl
- add some documentation
- at use sites, downgrade asserts we don't need, for an argument we don't use.
  we could also remove the argument, there's a single use site that uses it.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants