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

move hir typeck into separate crate #529

Closed
3 tasks done
lcnr opened this issue Jul 16, 2022 · 3 comments
Closed
3 tasks done

move hir typeck into separate crate #529

lcnr opened this issue Jul 16, 2022 · 3 comments
Labels
major-change A proposal to make a major change to rustc major-change-accepted A major change proposal that was accepted T-compiler Add this label so rfcbot knows to poll the compiler team

Comments

@lcnr
Copy link
Contributor

lcnr commented Jul 16, 2022

Proposal

With rust-lang/rust#99015 landing, the typeck query is the only place using an FnCtxt and this should stay this way. HIR typeck is a fairly complex and self contained part of rustc and moving all of that in a separate, common place should make refactorings and cleanups easier. It should also be easier to understand and more difficult to misuse, as you would have to add a dependency on a new crate to use the FnCtxt now.

We should move the typeck queries, FnCtxt and anything else exclusively used by HIR typeck to a new crate rustc_hir_typeck.

At the same time I also suggest renaming rustc_typeck to rustc_hir_analysis as that crate is responsible for so much more than simply "checking types".

Mentors or Reviewers

If you have a reviewer or mentor in mind for this work, mention then
here. You can put your own name here if you are planning to mentor the
work.

Process

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

  • File an issue describing the proposal.
  • A compiler 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.
    • Compiler 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.

@lcnr lcnr added T-compiler Add this label so rfcbot knows to poll the compiler team major-change A proposal to make a major change to rustc labels Jul 16, 2022
@rustbot
Copy link
Collaborator

rustbot commented Jul 16, 2022

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/compiler @rust-lang/compiler-contributors

@rustbot rustbot added the to-announce Announce this issue on triage meeting label Jul 16, 2022
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Jul 21, 2022
@compiler-errors
Copy link
Member

Since this change will be mostly moving things around and name changing, I don't think this is particularly controversial. Things under rustc_typeck/src/check/fn_ctxt are already somewhat self-contained.

@rustbot second

@rustbot rustbot added the final-comment-period The FCP has started, most (if not all) team members are in agreement label Jul 25, 2022
@apiraino
Copy link
Contributor

apiraino commented Aug 4, 2022

@rustbot label -final-comment-period +major-change-accepted

@apiraino apiraino closed this as completed Aug 4, 2022
@rustbot rustbot added major-change-accepted A major change proposal that was accepted to-announce Announce this issue on triage meeting and removed final-comment-period The FCP has started, most (if not all) team members are in agreement labels Aug 4, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Aug 15, 2022
change `InlineAsmCtxt` to not talk about `FnCtxt`

wip for rust-lang/compiler-team#529. this currently uses both the `FnCtxt` and is used by `check_mod_item_types`. This should be the only thing blocking that MCP afaict.

I am still unsure whether `rustc_hir_typeck` should depend on `rustc_hir_analysis` to use the `InlineAsmCtxt`. I think that's the best solution for now, so that's what I will go for

r? `@compiler-errors`
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Aug 25, 2022
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 27, 2022
…errors

rename rustc_typeck to rustc_hir_analysis

first part of rust-lang/compiler-team#529

r? `@compiler-errors`
bors added a commit to rust-lang-ci/rust that referenced this issue Oct 21, 2022
…rors

move hir typeck into separate crate

second part rust-lang/compiler-team#529

I avoided pretty much anything that wasn't just a simple move + path adjustment. Left fixmes for methods which are at an odd place

r? `@compiler-errors`
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this issue Apr 20, 2024
rename rustc_typeck to rustc_hir_analysis

first part of rust-lang/compiler-team#529

r? `@compiler-errors`
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this issue Apr 27, 2024
rename rustc_typeck to rustc_hir_analysis

first part of rust-lang/compiler-team#529

r? `@compiler-errors`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major-change A proposal to make a major change to rustc major-change-accepted A major change proposal that was accepted T-compiler Add this label so rfcbot knows to poll the compiler team
Projects
None yet
Development

No branches or pull requests

4 participants