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: {TyAnd,}Layout comes home #131473

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

workingjubilee
Copy link
Member

@workingjubilee workingjubilee commented Oct 9, 2024

The Layout and TyAndLayout types are heavily abstract and have no particular target-specific qualities, though we do use them to answer questions particular to targets. We can keep it that way if we simply move them out of rustc_target and into rustc_abi. They bring a small entourage of connected types with them, but that's fine.

This will allow us to strengthen a few abstraction barriers over time and thus make the notoriously gnarly layout code easier to refactor. For now, we don't need to worry about that and deliberately use reexports to minimize this particular diff.

@rustbot
Copy link
Collaborator

rustbot commented Oct 9, 2024

r? @Nadrieril

rustbot has assigned @Nadrieril.
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 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 Oct 9, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 9, 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 compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

@rustbot rustbot added the S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. label Oct 9, 2024
@workingjubilee
Copy link
Member Author

workingjubilee commented Oct 10, 2024

I am approaching this very incrementally to avoid Rebase Hell. I have peeked ahead a few commits and the next steps (removing all the reexports, thus redirecting imports from rustc_target to rustc_abi) involve touching more-or-less the entire tree. Fortunately, those commits will be possible to land in parallel after this.

@rustbot ready

@workingjubilee workingjubilee removed the S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. label Oct 10, 2024
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

The organization after this PR looks definitely more sane to me 👍 I don't work with ABI/codegen/target enough so won't r+ as I imagine other compiler reviewers will have a better gauge on this.

@saethlin
Copy link
Member

r? saethlin

@rustbot rustbot assigned saethlin and unassigned Nadrieril Oct 11, 2024
This finally unites TyAndLayout, Layout, and LayoutS into the same crate,
as one might imagine they would be placed. No functional changes.
@saethlin
Copy link
Member

@bors r+

If this is part of a larger effort, @workingjubilee can you link to that from this PR or mention this PR on the larger PR? Just so it's easier to follow the plot in GitHub, the code here is good to go.

@bors
Copy link
Contributor

bors commented Oct 13, 2024

📌 Commit 1072190 has been approved by saethlin

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 Oct 13, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 13, 2024
…=saethlin

compiler: `{TyAnd,}Layout` comes home

The `Layout` and `TyAndLayout` types are heavily abstract and have no particular target-specific qualities, though we do use them to answer questions particular to targets. We can keep it that way if we simply move them out of `rustc_target` and into `rustc_abi`. They bring a small entourage of connected types with them, but that's fine.

This will allow us to strengthen a few abstraction barriers over time and thus make the notoriously gnarly layout code easier to refactor. For now, we don't need to worry about that and deliberately use reexports to minimize this particular diff.
@workingjubilee
Copy link
Member Author

Oh, sure!

#131424 was the PR before this, the followups will link back to this one or maybe I'll make an issue. Basically we started migrating important components of layout code into rustc_abi... 2 years ago.. and never actually finished it, and all of the things I've even tried to work on for five minutes lately are made harder by the intense cross-crate couplings (that are cut very oddly, to boot).

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 14, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#128967 (std::fs::get_path freebsd update.)
 - rust-lang#129794 (uefi: Implement getcwd and chdir)
 - rust-lang#130629 (core/net: add Ipv[46]Addr::from_octets, Ipv6Addr::from_segments.)
 - rust-lang#131274 (library: Const-stabilize `MaybeUninit::assume_init_mut`)
 - rust-lang#131473 (compiler: `{TyAnd,}Layout` comes home)
 - rust-lang#131533 (emscripten: Use the latest emsdk 3.1.68)
 - rust-lang#131593 (miri: avoid cloning AllocExtra)
 - rust-lang#131616 (merge const_ipv4 / const_ipv6 feature gate into 'ip' feature gate)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 14, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#128967 (std::fs::get_path freebsd update.)
 - rust-lang#130629 (core/net: add Ipv[46]Addr::from_octets, Ipv6Addr::from_segments.)
 - rust-lang#131274 (library: Const-stabilize `MaybeUninit::assume_init_mut`)
 - rust-lang#131473 (compiler: `{TyAnd,}Layout` comes home)
 - rust-lang#131533 (emscripten: Use the latest emsdk 3.1.68)
 - rust-lang#131593 (miri: avoid cloning AllocExtra)
 - rust-lang#131616 (merge const_ipv4 / const_ipv6 feature gate into 'ip' feature gate)
 - rust-lang#131660 (Also use outermost const-anon for impl items in `non_local_defs` lint)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 14, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#128967 (std::fs::get_path freebsd update.)
 - rust-lang#130629 (core/net: add Ipv[46]Addr::from_octets, Ipv6Addr::from_segments.)
 - rust-lang#131274 (library: Const-stabilize `MaybeUninit::assume_init_mut`)
 - rust-lang#131473 (compiler: `{TyAnd,}Layout` comes home)
 - rust-lang#131533 (emscripten: Use the latest emsdk 3.1.68)
 - rust-lang#131593 (miri: avoid cloning AllocExtra)
 - rust-lang#131616 (merge const_ipv4 / const_ipv6 feature gate into 'ip' feature gate)
 - rust-lang#131660 (Also use outermost const-anon for impl items in `non_local_defs` lint)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 14, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#128967 (std::fs::get_path freebsd update.)
 - rust-lang#130629 (core/net: add Ipv[46]Addr::from_octets, Ipv6Addr::from_segments.)
 - rust-lang#131274 (library: Const-stabilize `MaybeUninit::assume_init_mut`)
 - rust-lang#131473 (compiler: `{TyAnd,}Layout` comes home)
 - rust-lang#131533 (emscripten: Use the latest emsdk 3.1.68)
 - rust-lang#131593 (miri: avoid cloning AllocExtra)
 - rust-lang#131616 (merge const_ipv4 / const_ipv6 feature gate into 'ip' feature gate)
 - rust-lang#131660 (Also use outermost const-anon for impl items in `non_local_defs` lint)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit cb140dc into rust-lang:master Oct 14, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Oct 14, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 14, 2024
Rollup merge of rust-lang#131473 - workingjubilee:move-that-abi-up, r=saethlin

compiler: `{TyAnd,}Layout` comes home

The `Layout` and `TyAndLayout` types are heavily abstract and have no particular target-specific qualities, though we do use them to answer questions particular to targets. We can keep it that way if we simply move them out of `rustc_target` and into `rustc_abi`. They bring a small entourage of connected types with them, but that's fine.

This will allow us to strengthen a few abstraction barriers over time and thus make the notoriously gnarly layout code easier to refactor. For now, we don't need to worry about that and deliberately use reexports to minimize this particular diff.
@workingjubilee workingjubilee deleted the move-that-abi-up branch October 14, 2024 17:53
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 21, 2024
… r=jieyouxu

Make `rustc_abi` compile on stable again

rust-lang#131473 accidentally broke this
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 21, 2024
Rollup merge of rust-lang#131997 - Veykril:veykril/push-upvqkyxmvkzw, r=jieyouxu

Make `rustc_abi` compile on stable again

rust-lang#131473 accidentally broke this
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Oct 22, 2024
Make `rustc_abi` compile on stable again

rust-lang/rust#131473 accidentally broke this
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.

6 participants