Skip to content

Tiny readability cleanups for initialization dataflow analyses - #160995

Merged
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
lqd:readabilly
Aug 21, 2026
Merged

Tiny readability cleanups for initialization dataflow analyses#160995
rust-bors[bot] merged 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
@jackh726

Copy link
Copy Markdown
Member

@bors r+

(sorry about the delay - this is actually very tiny, but looks bigger when reviewing on a phone)

@rust-bors

rust-bors Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 0d287e8 has been approved by jackh726

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 10. This pull request will be tested once the tree is reopened.

Reason for tree closure: Main branch is broken

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 20, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 20, 2026
Tiny readability cleanups for initialization dataflow analyses

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
@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors try jobs=i686-msvc-1
Triaging failure of #161417 (comment)

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 20, 2026
Tiny readability cleanups for initialization dataflow analyses


try-job: i686-msvc-1
@rust-bors

rust-bors Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: d5e2416 (d5e24166e2e2963bd6f3a4b2efbd598b3ffacb85)
Base parent: 8925ea3 (8925ea358a0f265ca61026aadc7ecc506c545cbe)

rust-bors Bot pushed a commit that referenced this pull request Aug 21, 2026
Rollup of 25 pull requests

Successful merges:

 - #152617 (std: implement `sleep_until` for Fuchsia)
 - #158934 (diagnostics: fix `let x: vec![]` suggestion pointing into stdlib)
 - #160995 (Tiny readability cleanups for initialization dataflow analyses)
 - #161277 (bootstrap: Move all non-module items out of the crate root)
 - #161295 (std: don't panic on long-elapsed deadlines for `sleep_until`)
 - #161368 (Double-word align `_Unwind_Exception`)
 - #161370 (Uplift rustfmt macro formatting fix)
 - #161378 (`FlowSensitiveAnalysis` cleanups)
 - #161420 (Bump wasm-component-ld to 0.5.30)
 - #161429 (Tighten allocator `Send`/`Sync` requirements for `Arc` in preparation for refactor)
 - #158032 (Offload expose device selection)
 - #158855 (Add `desktop` method to `CommandExt`)
 - #160299 (Stabilize `bool::toggle`)
 - #160842 (Apply `&[T]` visualizer to `*const [T]`, `*mut [T]` and `Box<[T]>`)
 - #160981 (Partially support building and locating wasm proc-macros)
 - #161199 (Add regression test for non lifetime binders)
 - #161212 (rust-installer/install-template.sh: catch cp(1) error when installing…)
 - #161302 (Add regression test for inconsistent import resolution from issue 147208)
 - #161329 (Add regression tests for a few fixed issues with E-needs-test)
 - #161330 (Add regression test for nested RPIT not an iterator ICE)
 - #161331 (Bitset simplifications)
 - #161340 (rustdoc: enable scrolling only on table/code)
 - #161351 (Cleanup: Move impl of `#[rustc_dump_object_lifetime_defaults]`)
 - #161355 (Add file path to some archive build errors)
 - #161373 (Allow running EC2 jobs locally)
rust-bors Bot pushed a commit that referenced this pull request Aug 21, 2026
Rollup of 25 pull requests

Successful merges:

 - #152617 (std: implement `sleep_until` for Fuchsia)
 - #158934 (diagnostics: fix `let x: vec![]` suggestion pointing into stdlib)
 - #160995 (Tiny readability cleanups for initialization dataflow analyses)
 - #161277 (bootstrap: Move all non-module items out of the crate root)
 - #161295 (std: don't panic on long-elapsed deadlines for `sleep_until`)
 - #161368 (Double-word align `_Unwind_Exception`)
 - #161370 (Uplift rustfmt macro formatting fix)
 - #161378 (`FlowSensitiveAnalysis` cleanups)
 - #161420 (Bump wasm-component-ld to 0.5.30)
 - #161429 (Tighten allocator `Send`/`Sync` requirements for `Arc` in preparation for refactor)
 - #158032 (Offload expose device selection)
 - #158855 (Add `desktop` method to `CommandExt`)
 - #160299 (Stabilize `bool::toggle`)
 - #160842 (Apply `&[T]` visualizer to `*const [T]`, `*mut [T]` and `Box<[T]>`)
 - #160981 (Partially support building and locating wasm proc-macros)
 - #161199 (Add regression test for non lifetime binders)
 - #161212 (rust-installer/install-template.sh: catch cp(1) error when installing…)
 - #161302 (Add regression test for inconsistent import resolution from issue 147208)
 - #161329 (Add regression tests for a few fixed issues with E-needs-test)
 - #161330 (Add regression test for nested RPIT not an iterator ICE)
 - #161331 (Bitset simplifications)
 - #161340 (rustdoc: enable scrolling only on table/code)
 - #161351 (Cleanup: Move impl of `#[rustc_dump_object_lifetime_defaults]`)
 - #161355 (Add file path to some archive build errors)
 - #161373 (Allow running EC2 jobs locally)
@rust-bors
rust-bors Bot merged commit 649278e into rust-lang:main Aug 21, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Aug 21, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 21, 2026
Rollup merge of #160995 - lqd:readabilly, r=jackh726

Tiny readability cleanups for initialization dataflow analyses

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
lqd deleted the readabilly branch August 21, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

4 participants