-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Clean up Trivial*Impls
macros
#136563
Merged
Merged
Clean up Trivial*Impls
macros
#136563
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri, @rust-lang/wg-const-eval Some changes occurred in cc @BoxyUwU |
lcnr
reviewed
Feb 5, 2025
one more suggestion, then r=me |
We have four macros for generating trivial traversal (fold/visit) and lift impls. - `rustc_ir::TrivialTypeTraversalImpls` - `rustc_middle::TrivialTypeTraversalImpls` - `rustc_middle::TrivialLiftImpls` - `rustc_middle::TrivialTypeTraversalAndLiftImpls` The first two are very similar. The last one just combines the second and third one. The macros themselves are ok, but their use is a mess. This commit does the following. - Removes types that no longer need a lift and/or traversal impl from the macro calls. - Consolidates the macro calls into the smallest number of calls possible, with each one mentioning as many types as possible. - Orders the types within those macro calls alphabetically, and makes the module qualification more consistent. - Eliminates `rustc_middle::mir::type_foldable`, because the macro calls were merged and the manual `TypeFoldable` impls are better placed in `structural_impls.rs`, alongside all the other ones. This makes the code more concise. Moving forward, it also makes it more obvious where new types should be added.
This has been bugging me for some time.
65ad805
to
d282a67
Compare
I added the tidy alphabetical lines. @bors r=lcnr rollup |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 6, 2025
…kingjubilee Rollup of 13 pull requests Successful merges: - rust-lang#133932 (Avoid using make_direct_deprecated() in extern "ptx-kernel") - rust-lang#136269 (Pass spans around new solver) - rust-lang#136550 (Fix `rustc_hidden_type_of_opaques` for RPITITs with no default body) - rust-lang#136558 (Document minimum supported host tooling on macOS) - rust-lang#136563 (Clean up `Trivial*Impls` macros) - rust-lang#136566 (Fix link in from_fn.rs) - rust-lang#136573 (Document why some "type mismatches" exist) - rust-lang#136583 (Only highlight unmatchable parameters at the definition site) - rust-lang#136587 (Update browser-ui-test version to `0.20.2`) - rust-lang#136590 (Implement RustcInternal for RawPtrKind) - rust-lang#136591 (Add `rustc_hir_pretty::expr_to_string` function) - rust-lang#136595 (Fix `unreachable_pub` lint for hermit target) - rust-lang#136611 (cg_llvm: Remove the `mod llvm_` hack, which should no longer be necessary) Failed merges: - rust-lang#136565 (compiler: Clean up weird `rustc_abi` reexports) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 6, 2025
Rollup merge of rust-lang#136563 - nnethercote:clean-up-Trivials, r=lcnr Clean up `Trivial*Impls` macros They're currently quite messy. Details in the individual commit logs. r? `@lcnr`
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
They're currently quite messy. Details in the individual commit logs.
r? @lcnr