-
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
misc layout_of
cleanup
#137218
Merged
Merged
misc layout_of
cleanup
#137218
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
- group the fluent slugs together - reword (internal-only) "too generic" error to be more in line with the other errors
`ty::Placeholder` is used by the trait solver and computing its layout was necessary, because the `PointerLike` trait used to be automatically implemented for all types with pointer-like layout. Nowadays, `PointerLike` requires user-written impls and the trait solver no longer computes any layouts, so this can be removed. Unevaluated constants that aren't generic should have caused a const eval error earlier during normalization.
- we normalize before calling `layout_of_uncached`, so we don't need to normalize again later - we check for type/const errors at the top of `layout_of_uncached`, so we don't need to check again later
Remove the `repr` parameter from the wrappers around `calc.univariant`, because it's always defaulted. Only ADTs can have a repr and those call `calc.layout_of_struct_or_enum` and not `calc.univariant`.
- change function parameter order to `cx, ty, ...` to match the other functions in this file - use `ct` identifier for `ty::Const` to match the majority of the compiler codebase - remove useless return - bring match arms in a more natural order
compiler-errors
approved these changes
Feb 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great cleanups
r? compiler-errors @bors r+ rollup |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 18, 2025
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#135711 (Do not ICE on default_field_value const with lifetimes) - rust-lang#136599 (librustdoc: more usages of `Joined::joined`) - rust-lang#136876 (Locking documentation updates) - rust-lang#137000 (Deeply normalize item bounds in new solver) - rust-lang#137126 (fix docs for inherent str constructors) - rust-lang#137161 (Pattern Migration 2024: fix incorrect messages/suggestions when errors arise in macro expansions) - rust-lang#137191 (Update mdbook and move error_index_generator) - rust-lang#137203 (Improve MIR modification) - rust-lang#137206 (Make E0599 a structured error) - rust-lang#137218 (misc `layout_of` cleanup) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 19, 2025
Rollup merge of rust-lang#137218 - lukas-code:layout_of_cleanup, r=compiler-errors misc `layout_of` cleanup See individual commits for details. r? `@oli-obk` but feel free to reassign
github-actions bot
pushed a commit
to tautschnig/verify-rust-std
that referenced
this pull request
Mar 11, 2025
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#135711 (Do not ICE on default_field_value const with lifetimes) - rust-lang#136599 (librustdoc: more usages of `Joined::joined`) - rust-lang#136876 (Locking documentation updates) - rust-lang#137000 (Deeply normalize item bounds in new solver) - rust-lang#137126 (fix docs for inherent str constructors) - rust-lang#137161 (Pattern Migration 2024: fix incorrect messages/suggestions when errors arise in macro expansions) - rust-lang#137191 (Update mdbook and move error_index_generator) - rust-lang#137203 (Improve MIR modification) - rust-lang#137206 (Make E0599 a structured error) - rust-lang#137218 (misc `layout_of` cleanup) r? `@ghost` `@rustbot` modify labels: rollup
github-actions bot
pushed a commit
to tautschnig/verify-rust-std
that referenced
this pull request
Mar 11, 2025
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#135711 (Do not ICE on default_field_value const with lifetimes) - rust-lang#136599 (librustdoc: more usages of `Joined::joined`) - rust-lang#136876 (Locking documentation updates) - rust-lang#137000 (Deeply normalize item bounds in new solver) - rust-lang#137126 (fix docs for inherent str constructors) - rust-lang#137161 (Pattern Migration 2024: fix incorrect messages/suggestions when errors arise in macro expansions) - rust-lang#137191 (Update mdbook and move error_index_generator) - rust-lang#137203 (Improve MIR modification) - rust-lang#137206 (Make E0599 a structured error) - rust-lang#137218 (misc `layout_of` cleanup) r? `@ghost` `@rustbot` modify labels: rollup
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.
See individual commits for details.
r? @oli-obk but feel free to reassign