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

compiler: validate.rs belongs next to what it validates #125483

Merged

Conversation

workingjubilee
Copy link
Member

@workingjubilee workingjubilee commented May 24, 2024

It's hard to find code that is deeply nested and far away from its callsites, so let's move rustc_const_eval::transform::validate into rustc_mir_transform, where all of its callers are. As rustc_mir_transform already depends on rustc_const_eval, the added visible dependency edge doesn't mean the dependency tree got any worse.

This also lets us unnest the check_consts module.

I did look into moving everything inside rustc_const_eval::transform into rustc_mir_transform. It turned out to be a much more complex operation, with more concerns and real edges into the const_eval crate, whereas this was both faster and more obvious.

@rustbot
Copy link
Collaborator

rustbot commented May 24, 2024

r? @saethlin

rustbot has assigned @saethlin.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot
Copy link
Collaborator

rustbot commented May 24, 2024

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@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 May 24, 2024
@oli-obk
Copy link
Contributor

oli-obk commented May 24, 2024

r? @oli-obk

r=me with CI happy

@rustbot rustbot assigned oli-obk and unassigned saethlin May 24, 2024
@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented May 24, 2024

The Miri subtree was changed

cc @rust-lang/miri

@workingjubilee
Copy link
Member Author

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented May 24, 2024

📌 Commit e57c935 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors 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 May 24, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 24, 2024
…te-to-mir-transform, r=oli-obk

compiler: validate.rs belongs next to what it validates

It's hard to find code that is deeply nested and far away from its callsites, so let's move `rustc_const_eval::transform::validate` into `rustc_mir_transform`, where all of its callers are. As `rustc_mir_transform` already depends on `rustc_const_eval`, the added visible dependency edge doesn't mean the dependency tree got any worse.

This also lets us unnest the `check_consts` module.

I did look into moving everything inside `rustc_const_eval::transform` into `rustc_mir_transform`. It turned out to be a much more complex operation, with more concerns and real edges into the `const_eval` crate, whereas this was both faster and more obvious.
@bors
Copy link
Contributor

bors commented May 24, 2024

⌛ Testing commit e57c935 with merge bdb1fa2...

@oli-obk
Copy link
Contributor

oli-obk commented May 24, 2024

@bors r- conflicts

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 24, 2024
@bors
Copy link
Contributor

bors commented May 24, 2024

☔ The latest upstream changes (presumably #125479) made this pull request unmergeable. Please resolve the merge conflicts.

@fmease
Copy link
Member

fmease commented May 24, 2024

@bors retry r- force

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 24, 2024
@workingjubilee workingjubilee force-pushed the move-transform-validate-to-mir-transform branch from e57c935 to 14fc3fd Compare May 24, 2024 16:56
@workingjubilee
Copy link
Member Author

"ooh, I'm a version control system with the ability to automatically merge branches together! except I can't do the MOST OBVIOUS POSSIBLE MERGE! use me because I'm so much better than all those other version control systems! bluh bluh!"

@workingjubilee
Copy link
Member Author

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented May 24, 2024

📌 Commit 14fc3fd has been approved by oli-obk

It is now in the queue for this repository.

@bors bors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 24, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 24, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#125467 (Only suppress binop error in favor of semicolon suggestion if we're in an assignment statement)
 - rust-lang#125483 (compiler: validate.rs belongs next to what it validates)
 - rust-lang#125485 (Migrate `run-make/rustdoc-with-output-dir-option` to `rmake.rs`)
 - rust-lang#125497 (Fix some SIMD intrinsics documentation)
 - rust-lang#125501 (Resolve anon const's parent predicates to direct parent instead of opaque's parent)
 - rust-lang#125503 (rustdoc-json: Add test for keywords with `--document-private-items`)
 - rust-lang#125519 (tag more stuff with `WG-trait-system-refactor`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f23ebf0 into rust-lang:master May 24, 2024
6 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 24, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 24, 2024
Rollup merge of rust-lang#125483 - workingjubilee:move-transform-validate-to-mir-transform, r=oli-obk

compiler: validate.rs belongs next to what it validates

It's hard to find code that is deeply nested and far away from its callsites, so let's move `rustc_const_eval::transform::validate` into `rustc_mir_transform`, where all of its callers are. As `rustc_mir_transform` already depends on `rustc_const_eval`, the added visible dependency edge doesn't mean the dependency tree got any worse.

This also lets us unnest the `check_consts` module.

I did look into moving everything inside `rustc_const_eval::transform` into `rustc_mir_transform`. It turned out to be a much more complex operation, with more concerns and real edges into the `const_eval` crate, whereas this was both faster and more obvious.
@workingjubilee workingjubilee deleted the move-transform-validate-to-mir-transform branch May 24, 2024 23:42
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.

7 participants