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

Type system refactorings for further rustc_type_ir-ification #124

Closed
1 of 3 tasks
compiler-errors opened this issue Oct 18, 2023 · 3 comments
Closed
1 of 3 tasks
Labels
major-change A major change proposal major-change-accepted An accepted major change proposal T-types Add this label so rfcbot knows to poll the types team

Comments

@compiler-errors
Copy link
Member

Proposal

I propose the following changes that will have a large footprint, but will ultimately simplify rustc_type_ir migration:

  1. Get rid of TypeAndMut and just have the tykind variant be RawPtr(Ty, Mutability), like how refs are just Ref(Region, Ty, Mutability).

  2. Remove the type system's dependency on hir::Mutability and hir::Movability and copy both of these enums into rustc_type_ir (will require converting between hir::Mutability and ty::Mutability during astconv).

Mentors or Reviewers

I'll make the changes.

Process

The main points of the Major Change Process are as follows:

  • File an issue describing the proposal.
  • A types team member or contributor who is knowledgeable in the area can second by writing @rustbot second.
    • Finding a "second" suffices for internal changes. If however, you are proposing a new public-facing feature, such as a -C flag, then full team check-off is required.
    • Types team members can initiate a check-off via @rfcbot fcp merge on either the MCP or the PR.
  • Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Comments

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

@compiler-errors compiler-errors added major-change A major change proposal T-types Add this label so rfcbot knows to poll the types team labels Oct 18, 2023
@rustbot
Copy link
Collaborator

rustbot commented Oct 18, 2023

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

cc @rust-lang/types

@rustbot rustbot added the to-announce Announce this issue on triage meeting label Oct 18, 2023
@jackh726
Copy link
Member

@rustbot second

@rustbot rustbot added the final-comment-period The FCP has started, most (if not all) team members are in agreement label Oct 18, 2023
bors added a commit to rust-lang-ci/rust that referenced this issue Oct 20, 2023
…ility, r=lcnr

Uplift movability and mutability, the simple way

Just make type_ir a dependency of ast. This can be relaxed later if we want to make the dependency less heavy. Part of rust-lang/types-team#124.

r? `@lcnr` or `@jackh726`
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Oct 21, 2023
…lcnr

Uplift movability and mutability, the simple way

Just make type_ir a dependency of ast. This can be relaxed later if we want to make the dependency less heavy. Part of rust-lang/types-team#124.

r? `@lcnr` or `@jackh726`
@jackh726 jackh726 added major-change-accepted An accepted major change proposal and removed final-comment-period The FCP has started, most (if not all) team members are in agreement to-announce Announce this issue on triage meeting labels Dec 4, 2023
@jackh726
Copy link
Member

jackh726 commented Dec 4, 2023

Closing as accepted.

@jackh726 jackh726 closed this as completed Dec 4, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 15, 2023
…, r=jackh726

Uplift `TypeAndMut` and `ClosureKind` to `rustc_type_ir`

Uplifts `TypeAndMut` and `ClosureKind`

I know I said I was just going to get rid of `TypeAndMut` (rust-lang/types-team#124) but I think this is much simpler, lol

r? `@jackh726` or `@lcnr`
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Dec 15, 2023
Rollup merge of rust-lang#118888 - compiler-errors:uplift-more-things, r=jackh726

Uplift `TypeAndMut` and `ClosureKind` to `rustc_type_ir`

Uplifts `TypeAndMut` and `ClosureKind`

I know I said I was just going to get rid of `TypeAndMut` (rust-lang/types-team#124) but I think this is much simpler, lol

r? `@jackh726` or `@lcnr`
flip1995 pushed a commit to flip1995/rust-clippy that referenced this issue Dec 16, 2023
Uplift `TypeAndMut` and `ClosureKind` to `rustc_type_ir`

Uplifts `TypeAndMut` and `ClosureKind`

I know I said I was just going to get rid of `TypeAndMut` (rust-lang/types-team#124) but I think this is much simpler, lol

r? `@jackh726` or `@lcnr`
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 22, 2024
Remove `TypeAndMut` from `ty::RawPtr` variant, make it take `Ty` and `Mutability`

Pretty much mechanically converting `ty::RawPtr(ty::TypeAndMut { ty, mutbl })` to `ty::RawPtr(ty, mutbl)` and its fallout.

r? lcnr

cc rust-lang/types-team#124
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Mar 23, 2024
Remove `TypeAndMut` from `ty::RawPtr` variant, make it take `Ty` and `Mutability`

Pretty much mechanically converting `ty::RawPtr(ty::TypeAndMut { ty, mutbl })` to `ty::RawPtr(ty, mutbl)` and its fallout.

r? lcnr

cc rust-lang/types-team#124
bjorn3 pushed a commit to rust-lang/rustc_codegen_cranelift that referenced this issue Mar 25, 2024
Remove `TypeAndMut` from `ty::RawPtr` variant, make it take `Ty` and `Mutability`

Pretty much mechanically converting `ty::RawPtr(ty::TypeAndMut { ty, mutbl })` to `ty::RawPtr(ty, mutbl)` and its fallout.

r? lcnr

cc rust-lang/types-team#124
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major-change A major change proposal major-change-accepted An accepted major change proposal T-types Add this label so rfcbot knows to poll the types team
Projects
None yet
Development

No branches or pull requests

3 participants