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

misc layout_of cleanup #137218

Merged
merged 6 commits into from
Feb 19, 2025
Merged

misc layout_of cleanup #137218

merged 6 commits into from
Feb 19, 2025

Conversation

lukas-code
Copy link
Member

See individual commits for details.

r? @oli-obk but feel free to reassign

Lukas Markeffsky added 6 commits February 18, 2025 13:22
- 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
@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 Feb 18, 2025
Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

Great cleanups

@compiler-errors
Copy link
Member

r? compiler-errors @bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 18, 2025

📌 Commit 2fbc413 has been approved by compiler-errors

It is now in the queue for this repository.

@rustbot rustbot assigned compiler-errors and unassigned oli-obk Feb 18, 2025
@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 Feb 18, 2025
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
@bors bors merged commit bafff1b into rust-lang:master Feb 19, 2025
6 checks passed
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
@rustbot rustbot added this to the 1.87.0 milestone Feb 19, 2025
@lukas-code lukas-code deleted the layout_of_cleanup branch February 19, 2025 11:13
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants