Skip to content

Expand on MIR type checking. - #2982

Merged
fallible-algebra merged 1 commit into
rust-lang:mainfrom
fallible-algebra:types-overhaul/mir-tyck
Aug 24, 2026
Merged

Expand on MIR type checking.#2982
fallible-algebra merged 1 commit into
rust-lang:mainfrom
fallible-algebra:types-overhaul/mir-tyck

Conversation

@fallible-algebra

Copy link
Copy Markdown
Member

Drilled too hard into this one topic, came back up with a small change to the MIR type check article.

This should be followed up with a couple of things:

  • Moving this to the "analysis" folder, this is part of a general want to re-structure the folder structure that's come up in conversations with boxy.
  • Vestigial uses of region uniquification need to be identified and talked about. Region uniquification itself needs to be talked about even though it's been largely abandoned as a strategy. Notes that were cut can be found here, mostly out of conversations with myself and lcnr/boxy.

@rustbot

rustbot commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR. If you have write access, feel free to merge this PR if it does not need reviews. You can request a review using r? rustc-dev-guide or r? <username>.

@rustbot rustbot added the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label Aug 24, 2026
Comment thread src/borrow-check/type-check.md Outdated
Comment thread src/borrow-check/type-check.md Outdated

Doing this additional type checking pass on it also allows us to check our working: If something fails in MIR tyck that passed in HIR type checking, something has gone wrong.

MIR type checking should succeed if HIR type checking succeeds. This is not trivial for a number of reasons, one of which being the vestigial instances of Region Uniquification.

@BoxyUwU BoxyUwU Aug 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i dont think "vestigial" is correct here

View changes since the review

@fallible-algebra
fallible-algebra force-pushed the types-overhaul/mir-tyck branch from 20cfff9 to 16b9fcf Compare August 24, 2026 15:18
Comment thread src/borrow-check/type-check.md Outdated
## User types

At the start of MIR type-check, we replace all regions in the body with new unconstrained regions.
At the start of MIR type_check, we replace all regions in the body with new unconstrained regions.

@BoxyUwU BoxyUwU Aug 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
At the start of MIR type_check, we replace all regions in the body with new unconstrained regions.
At the start of MIR typechecking, we replace all regions in the body with new unconstrained regions.

View changes since the review

@fallible-algebra
fallible-algebra force-pushed the types-overhaul/mir-tyck branch from 16b9fcf to 4f8e147 Compare August 24, 2026 15:33
@fallible-algebra
fallible-algebra merged commit b10960c into rust-lang:main Aug 24, 2026
1 check passed
@rustbot rustbot removed the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants