Skip to content

Flatten prove::prove::prove module nesting (#418) - #431

Merged
nikomatsakis merged 3 commits into
rust-lang:mainfrom
Mslady-jojo:flatten-prove-module
Jul 21, 2026
Merged

Flatten prove::prove::prove module nesting (#418)#431
nikomatsakis merged 3 commits into
rust-lang:mainfrom
Mslady-jojo:flatten-prove-module

Conversation

@Mslady-jojo

Copy link
Copy Markdown
Contributor

Problem

The prove module in formality-rust was nested three levels deep (prove::prove::prove::*), with prove.rs declaring a submodule prove (prove/prove.rs), which itself declared another submodule prove (prove/prove/prove.rs) containing the actual proving logic (env, prove_eq, prove_wf, combinators, etc). This meant every import path across the codebase had to spell out crate::prove::prove::prove::X or crate::prove::prove::X just to reach ordinary sibling items, with no corresponding conceptual separation to justify the extra layers.

What changed:

  • Moved all files from prove/prove/prove/* and prove/prove/* up into prove/* directly (git mv, so history is preserved).
  • Merged the two wrapper files (prove/prove.rs and prove/prove/prove.rs) directly into the top-level prove.rs, combining their mod declarations and pub use re-exports (de-duplicating overlapping re-exports like Constrained/Constraints and the negation functions, which were previously re-exported from two places).
  • Updated all 48 call sites across the codebase (in check/, codegen/, to_rust/, grammar/, and within prove/ itself) from crate::prove::prove::X / crate::prove::prove::prove::X to the flat crate::prove::X.
  • Regenerated expect_test snapshots in tests/basic_tests.rs where the expected output embedded the old (now-changed) source file paths in panic/error messages. No logic or assertion values changed only the file path strings.
    cargo clippy --all-targets : same pre-existing warning count as main; no new warnings introduced, and none touch files modified in this PR. Left untouched to keep this PR scoped to the module restructuring only.
    This is a pure structural refactor no behavior changes.

@rustbot

rustbot commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Thanks for contributing to formality! :)
A reviewer will take a look at your PR within a week or two. If not, come talk to us on https://rust-lang.zulipchat.com/#narrow/channel/402470-t-types.2Fformality

@rustbot

This comment has been minimized.

@nikomatsakis nikomatsakis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This needs to be rebased @Mslady-jojo :(

View changes since this review

@tiif tiif left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I checked through the files, 👍 from me, shouldn't have any functional change.

View changes since this review

Collapses the triple-nested prove module structure into a single flat
prove module. No logic changes - this is a pure structural refactor.
Updated all import paths accordingly. Test snapshots updated to reflect
new file paths in error messages.
@nikomatsakis
nikomatsakis force-pushed the flatten-prove-module branch from e099a56 to 4d5c4d4 Compare July 21, 2026 16:55
@rustbot

rustbot commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@nikomatsakis nikomatsakis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This needs to be rebased @Mslady-jojo :(

View changes since this review

@nikomatsakis
nikomatsakis added this pull request to the merge queue Jul 21, 2026
Merged via the queue into rust-lang:main with commit 856ccea Jul 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants