Move Layout to rustc_type_ir and rustc_middle and implement (de)serialization#158576
Move Layout to rustc_type_ir and rustc_middle and implement (de)serialization#158576camelid wants to merge 11 commits into
Layout to rustc_type_ir and rustc_middle and implement (de)serialization#158576Conversation
|
cc @bjorn3 Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri
Some changes occurred to the CTFE machinery Some changes occurred in compiler/rustc_sanitizers cc @rcvalle This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a, @makai410 These commits modify the If this was unintentional then you should revert the changes before this PR is merged.
cc @rust-lang/miri |
| /// should generally only be relevant to the ABI details of | ||
| /// specific targets. | ||
| #[tracing::instrument(skip(cx), level = "debug")] | ||
| pub fn homogeneous_aggregate<C>(&self, cx: &C) -> Result<HomogeneousAggregate, Heterogeneous> |
There was a problem hiding this comment.
So this becomes a free function in rustc_target::callconv
| Copy, | ||
| Clone, |
There was a problem hiding this comment.
pure unadulterated off-topic whining that for some reason I feel needs to be said anyways why can't derive(Copy) just imply derive(Clone) sheesh, this only gets so long because of that. it makes sense why it isn't true for Ord and Eq but...
It can mostly be reviewed commit-by-commit. The history isn't as clean as I'd like, though it's mostly modular. Like all or most commits should compile without errors on their own. |
|
Almost all of the diff is just changing |
|
rust-analyzer supports showing type layouts. Does that still work with this PR? I don't know if it reuses the rustc layout definitions or not. |
|
rust-analyzer should be OK. |
|
Looks like rust-analyzer only uses |
Layout to rustc_type_ir and rustc_middleLayout to rustc_type_ir and rustc_middle and implement (de)serialization
This comment has been minimized.
This comment has been minimized.
FYI as of now due to the fast pace development of the next solver, even in-tree r-a depends on rustc crates from crates.io instead of in-tree. So the fact that it compiles is not a proof, although yes this change isn't problematic for us. |
This comment has been minimized.
This comment has been minimized.
|
what |
This comment has been minimized.
This comment has been minimized.
|
HIR ty lowering was modified cc @fmease |
This is in preparation for moving it from rustc_abi to rustc_target.
This is in preparation for moving Layout and TyAndLayout to rustc_type_ir/rustc_middle. rustc_abi is a dependency of rustc_type_ir, which is why homogeneous_aggregate (which uses TyAndLayout) needs to be moved. Longer-term, we should probably separate the data structures of rustc_abi from the code that computes them. It seems a bit weird to have rustc_type_ir depend on layout-computation code.
Since `Layout`s are interned `LayoutData` values, it makes sense for it to be with the other interned data structures. This will allow us to derive `TyDecodable` for `Layout`.
|
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. |
|
Added an experimental commit to see if caching layout_of on disk helps perf at all (not the reason for this refactoring, but want to check it out anyway). @bors try @rust-timer queue |
|
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
This comment has been minimized.
This comment has been minimized.
Move `Layout` to `rustc_type_ir` and `rustc_middle` and implement (de)serialization
|
Agh the rebase needs an extra change. @bors try cancel |
|
Try build cancelled. Cancelled workflows: |
This comment has been minimized.
This comment has been minimized.
A bit gross, but should simplify the refactoring.
|
@bors try @rust-timer queue |
|
This pull request is already queued and waiting for a try build to finish. |
This comment has been minimized.
This comment has been minimized.
Move `Layout` to `rustc_type_ir` and `rustc_middle` and implement (de)serialization
|
☔ The latest upstream changes (presumably #158610) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
|
The job Click to see the possible cause of the failure (guessed by this bot)Important For more information how to resolve CI failures of this job, visit this link. |
|
Queued 18329f9 with parent 5165714, future comparison URL. |
View all comments