Uh oh!
There was an error while loading. Please reload this page.
Rename typing modes to better describe real usage - #157667
Conversation
rustbot
commented
Jun 9, 2026
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the CTFE machinery Some changes occurred to constck cc @fee1-dead Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
jdonszelmann
commented
Jun 9, 2026
sorry for the pings :3 |
There was a problem hiding this comment.
sgtm 🤔 there are two things I still slightly dislike about the new names
TypingMode::Typeck, PostTypeck, PostBorrowckare all the same if there are no opaques or coroutines. We could have a separate generalTypingMode::Analysiswhich is always used if the list of opaques etc etc would be empty. I thinkTypingMode::borrowckalready falls back toTypeckif there are no opaques in the defining scopePostTypeckis morePostTypeckUntilBorrowck. slightly cumbersome as a name, but maybe slightly better.
For completeness, with this PR
enum TypingMode {
Coherence,
Typeck,
PostTypeck, // used by borrowck and anything else that happens pre borrowck but uses typeck results
PostBorrowck, // opaques are fully inferred now, still don't reveal opaques from other bodies as it is userfacing
PostAnalysis, // optimizations etc etc
Codegen, // like `PostAnalysis`, but some query cycle stuff
}
a590b5f to
6921ae1Comparerustbot
commented
Jun 10, 2026
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. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jdonszelmann
commented
Jun 11, 2026
@bors r=lcnr |
…in, r=lcnr Rename typing modes to better describe real usage r? @lcnr cc: @BoxyUwU Lcnr and I brainstormed these names before RustWeek, but I never got to actually changing it. As for rationale: - `Coherence`: stays the same - `Analysis`: given that basically all of type checking is analyzing code, this didn't feel so accurate. It's now called `Typeck` to signify that it's mainly used during `hir_typeck`. - `Borrowck`: this is the one that actually started the discussion about renaming. Borrowck is used in quite a few places now that are *not* Borrowck, simply to avoid making inference progress on opaque types. It's renamed to `PostTypeckUntilBorrowck`, since its used after `Typeck`. - `PostBorrowckAnalysis` is now simply called `PostBorrowck`, since it's supposed to be used after borrowck finishes. - `PostAnalysis` stays the same, it's the typing mode used after all type analysis finished - There's now also a new `Codegen` typing mode. It's unchanged too. To preempt some questions, I mainly did this rename through normal editor renames. I then also did a search with various regexes over ever occurence of `//.*Analysis` and `//.*Borrowck` and `PostBorrowck`, and some more similar regexes to make sure as many comments as possible are updated, if not all. Notably, this PR does not update RustAnlayzer to use the same names yet. Warning: this PR may be somewhat conflicty :/
…in, r=lcnr Rename typing modes to better describe real usage r? @lcnr cc: @BoxyUwU Lcnr and I brainstormed these names before RustWeek, but I never got to actually changing it. As for rationale: - `Coherence`: stays the same - `Analysis`: given that basically all of type checking is analyzing code, this didn't feel so accurate. It's now called `Typeck` to signify that it's mainly used during `hir_typeck`. - `Borrowck`: this is the one that actually started the discussion about renaming. Borrowck is used in quite a few places now that are *not* Borrowck, simply to avoid making inference progress on opaque types. It's renamed to `PostTypeckUntilBorrowck`, since its used after `Typeck`. - `PostBorrowckAnalysis` is now simply called `PostBorrowck`, since it's supposed to be used after borrowck finishes. - `PostAnalysis` stays the same, it's the typing mode used after all type analysis finished - There's now also a new `Codegen` typing mode. It's unchanged too. To preempt some questions, I mainly did this rename through normal editor renames. I then also did a search with various regexes over ever occurence of `//.*Analysis` and `//.*Borrowck` and `PostBorrowck`, and some more similar regexes to make sure as many comments as possible are updated, if not all. Notably, this PR does not update RustAnlayzer to use the same names yet. Warning: this PR may be somewhat conflicty :/
…in, r=lcnr Rename typing modes to better describe real usage r? @lcnr cc: @BoxyUwU Lcnr and I brainstormed these names before RustWeek, but I never got to actually changing it. As for rationale: - `Coherence`: stays the same - `Analysis`: given that basically all of type checking is analyzing code, this didn't feel so accurate. It's now called `Typeck` to signify that it's mainly used during `hir_typeck`. - `Borrowck`: this is the one that actually started the discussion about renaming. Borrowck is used in quite a few places now that are *not* Borrowck, simply to avoid making inference progress on opaque types. It's renamed to `PostTypeckUntilBorrowck`, since its used after `Typeck`. - `PostBorrowckAnalysis` is now simply called `PostBorrowck`, since it's supposed to be used after borrowck finishes. - `PostAnalysis` stays the same, it's the typing mode used after all type analysis finished - There's now also a new `Codegen` typing mode. It's unchanged too. To preempt some questions, I mainly did this rename through normal editor renames. I then also did a search with various regexes over ever occurence of `//.*Analysis` and `//.*Borrowck` and `PostBorrowck`, and some more similar regexes to make sure as many comments as possible are updated, if not all. Notably, this PR does not update RustAnlayzer to use the same names yet. Warning: this PR may be somewhat conflicty :/
…in, r=lcnr Rename typing modes to better describe real usage r? @lcnr cc: @BoxyUwU Lcnr and I brainstormed these names before RustWeek, but I never got to actually changing it. As for rationale: - `Coherence`: stays the same - `Analysis`: given that basically all of type checking is analyzing code, this didn't feel so accurate. It's now called `Typeck` to signify that it's mainly used during `hir_typeck`. - `Borrowck`: this is the one that actually started the discussion about renaming. Borrowck is used in quite a few places now that are *not* Borrowck, simply to avoid making inference progress on opaque types. It's renamed to `PostTypeckUntilBorrowck`, since its used after `Typeck`. - `PostBorrowckAnalysis` is now simply called `PostBorrowck`, since it's supposed to be used after borrowck finishes. - `PostAnalysis` stays the same, it's the typing mode used after all type analysis finished - There's now also a new `Codegen` typing mode. It's unchanged too. To preempt some questions, I mainly did this rename through normal editor renames. I then also did a search with various regexes over ever occurence of `//.*Analysis` and `//.*Borrowck` and `PostBorrowck`, and some more similar regexes to make sure as many comments as possible are updated, if not all. Notably, this PR does not update RustAnlayzer to use the same names yet. Warning: this PR may be somewhat conflicty :/
…in, r=lcnr Rename typing modes to better describe real usage r? @lcnr cc: @BoxyUwU Lcnr and I brainstormed these names before RustWeek, but I never got to actually changing it. As for rationale: - `Coherence`: stays the same - `Analysis`: given that basically all of type checking is analyzing code, this didn't feel so accurate. It's now called `Typeck` to signify that it's mainly used during `hir_typeck`. - `Borrowck`: this is the one that actually started the discussion about renaming. Borrowck is used in quite a few places now that are *not* Borrowck, simply to avoid making inference progress on opaque types. It's renamed to `PostTypeckUntilBorrowck`, since its used after `Typeck`. - `PostBorrowckAnalysis` is now simply called `PostBorrowck`, since it's supposed to be used after borrowck finishes. - `PostAnalysis` stays the same, it's the typing mode used after all type analysis finished - There's now also a new `Codegen` typing mode. It's unchanged too. To preempt some questions, I mainly did this rename through normal editor renames. I then also did a search with various regexes over ever occurence of `//.*Analysis` and `//.*Borrowck` and `PostBorrowck`, and some more similar regexes to make sure as many comments as possible are updated, if not all. Notably, this PR does not update RustAnlayzer to use the same names yet. Warning: this PR may be somewhat conflicty :/
…uwer Rollup of 23 pull requests Successful merges: - #157716 (update Enzyme, June'26) - #149793 (Add inline asm support for amdgpu) - #152852 (Remove driver_lint_caps) - #155299 (make repr_transparent_non_zst_fields a hard error) - #155439 (Enable Cargo's new build-dir layout) - #157612 (Add a test where subtyping inhibits coercion.) - #157626 (Autogenerate unstable compiler flag stubs for unstable-book) - #157667 (Rename typing modes to better describe real usage) - #156212 (Additionally gate negative bounds behind new `-Zinternal-testing-features`) - #157342 (Reduce verbosity of cycle errors when possible) - #157366 (Add a regression test for an unconstrained TransmuteFrom ICE) - #157459 (rustc_target: callconv: powerpc64: Remove unreachable fallback code path) - #157658 (UnsafeCell: mention shared-ref-to-interior case, fix aliasing model inaccuracy) - #157698 (Remove an unnecessary cloning) - #157699 (Arg splat experiment - hir FnDecl impl) - #157713 (resolve: Remove exported imports from `maybe_unused_trait_imports`) - #157722 (Move create_scope_map to rustc_codegen_ssa.) - #157725 (Keep generic suggestion for macro-expanded missing-type items) - #157733 (Remove old FIXMEs about nocapture attribute) - #157737 (Reorganize `tests/ui/issues` [7/N]) - #157746 (supports_c_variadic_definitions: extend checklist for new targets) - #157763 (Move unused target expression error to appropriate place and rename it) - #157768 (codegen_ssa: peel trans. wrappers on scalable vecs)
…uwer Rollup of 23 pull requests Successful merges: - #157716 (update Enzyme, June'26) - #149793 (Add inline asm support for amdgpu) - #152852 (Remove driver_lint_caps) - #155299 (make repr_transparent_non_zst_fields a hard error) - #155439 (Enable Cargo's new build-dir layout) - #157612 (Add a test where subtyping inhibits coercion.) - #157626 (Autogenerate unstable compiler flag stubs for unstable-book) - #157667 (Rename typing modes to better describe real usage) - #156212 (Additionally gate negative bounds behind new `-Zinternal-testing-features`) - #157342 (Reduce verbosity of cycle errors when possible) - #157366 (Add a regression test for an unconstrained TransmuteFrom ICE) - #157459 (rustc_target: callconv: powerpc64: Remove unreachable fallback code path) - #157658 (UnsafeCell: mention shared-ref-to-interior case, fix aliasing model inaccuracy) - #157698 (Remove an unnecessary cloning) - #157699 (Arg splat experiment - hir FnDecl impl) - #157713 (resolve: Remove exported imports from `maybe_unused_trait_imports`) - #157722 (Move create_scope_map to rustc_codegen_ssa.) - #157725 (Keep generic suggestion for macro-expanded missing-type items) - #157733 (Remove old FIXMEs about nocapture attribute) - #157737 (Reorganize `tests/ui/issues` [7/N]) - #157746 (supports_c_variadic_definitions: extend checklist for new targets) - #157763 (Move unused target expression error to appropriate place and rename it) - #157768 (codegen_ssa: peel trans. wrappers on scalable vecs)
…in, r=lcnr Rename typing modes to better describe real usage r? @lcnr cc: @BoxyUwU Lcnr and I brainstormed these names before RustWeek, but I never got to actually changing it. As for rationale: - `Coherence`: stays the same - `Analysis`: given that basically all of type checking is analyzing code, this didn't feel so accurate. It's now called `Typeck` to signify that it's mainly used during `hir_typeck`. - `Borrowck`: this is the one that actually started the discussion about renaming. Borrowck is used in quite a few places now that are *not* Borrowck, simply to avoid making inference progress on opaque types. It's renamed to `PostTypeckUntilBorrowck`, since its used after `Typeck`. - `PostBorrowckAnalysis` is now simply called `PostBorrowck`, since it's supposed to be used after borrowck finishes. - `PostAnalysis` stays the same, it's the typing mode used after all type analysis finished - There's now also a new `Codegen` typing mode. It's unchanged too. To preempt some questions, I mainly did this rename through normal editor renames. I then also did a search with various regexes over ever occurence of `//.*Analysis` and `//.*Borrowck` and `PostBorrowck`, and some more similar regexes to make sure as many comments as possible are updated, if not all. Notably, this PR does not update RustAnlayzer to use the same names yet. Warning: this PR may be somewhat conflicty :/
…uwer Rollup of 23 pull requests Successful merges: - #157716 (update Enzyme, June'26) - #149793 (Add inline asm support for amdgpu) - #155299 (make repr_transparent_non_zst_fields a hard error) - #155439 (Enable Cargo's new build-dir layout) - #157612 (Add a test where subtyping inhibits coercion.) - #157626 (Autogenerate unstable compiler flag stubs for unstable-book) - #157667 (Rename typing modes to better describe real usage) - #149749 (Make `BorrowedBuf` and `BorrowedCursor` generic over the data) - #156212 (Additionally gate negative bounds behind new `-Zinternal-testing-features`) - #157342 (Reduce verbosity of cycle errors when possible) - #157366 (Add a regression test for an unconstrained TransmuteFrom ICE) - #157459 (rustc_target: callconv: powerpc64: Remove unreachable fallback code path) - #157658 (UnsafeCell: mention shared-ref-to-interior case, fix aliasing model inaccuracy) - #157698 (Remove an unnecessary cloning) - #157699 (Arg splat experiment - hir FnDecl impl) - #157713 (resolve: Remove exported imports from `maybe_unused_trait_imports`) - #157722 (Move create_scope_map to rustc_codegen_ssa.) - #157725 (Keep generic suggestion for macro-expanded missing-type items) - #157733 (Remove old FIXMEs about nocapture attribute) - #157737 (Reorganize `tests/ui/issues` [7/N]) - #157746 (supports_c_variadic_definitions: extend checklist for new targets) - #157763 (Move unused target expression error to appropriate place and rename it) - #157768 (codegen_ssa: peel trans. wrappers on scalable vecs)
Rollup of 24 pull requests Successful merges: - #157716 (update Enzyme, June'26) - #149793 (Add inline asm support for amdgpu) - #155299 (make repr_transparent_non_zst_fields a hard error) - #157612 (Add a test where subtyping inhibits coercion.) - #157626 (Autogenerate unstable compiler flag stubs for unstable-book) - #157667 (Rename typing modes to better describe real usage) - #149749 (Make `BorrowedBuf` and `BorrowedCursor` generic over the data) - #155113 (Ensure Send/Sync impl for std::process::CommandArgs) - #156212 (Additionally gate negative bounds behind new `-Zinternal-testing-features`) - #157342 (Reduce verbosity of cycle errors when possible) - #157366 (Add a regression test for an unconstrained TransmuteFrom ICE) - #157459 (rustc_target: callconv: powerpc64: Remove unreachable fallback code path) - #157658 (UnsafeCell: mention shared-ref-to-interior case, fix aliasing model inaccuracy) - #157698 (Remove an unnecessary cloning) - #157699 (Arg splat experiment - hir FnDecl impl) - #157713 (resolve: Remove exported imports from `maybe_unused_trait_imports`) - #157722 (Move create_scope_map to rustc_codegen_ssa.) - #157723 (Move uninhabited unreachable code lint to rustc_mir_transform) - #157725 (Keep generic suggestion for macro-expanded missing-type items) - #157733 (Remove old FIXMEs about nocapture attribute) - #157737 (Reorganize `tests/ui/issues` [7/N]) - #157746 (supports_c_variadic_definitions: extend checklist for new targets) - #157763 (Move unused target expression error to appropriate place and rename it) - #157768 (codegen_ssa: peel trans. wrappers on scalable vecs)
Uh oh!
There was an error while loading. Please reload this page.
Rollup merge of #157667 - jdonszelmann:rename-typingmode-again, r=lcnr Rename typing modes to better describe real usage r? @lcnr cc: @BoxyUwU Lcnr and I brainstormed these names before RustWeek, but I never got to actually changing it. As for rationale: - `Coherence`: stays the same - `Analysis`: given that basically all of type checking is analyzing code, this didn't feel so accurate. It's now called `Typeck` to signify that it's mainly used during `hir_typeck`. - `Borrowck`: this is the one that actually started the discussion about renaming. Borrowck is used in quite a few places now that are *not* Borrowck, simply to avoid making inference progress on opaque types. It's renamed to `PostTypeckUntilBorrowck`, since its used after `Typeck`. - `PostBorrowckAnalysis` is now simply called `PostBorrowck`, since it's supposed to be used after borrowck finishes. - `PostAnalysis` stays the same, it's the typing mode used after all type analysis finished - There's now also a new `Codegen` typing mode. It's unchanged too. To preempt some questions, I mainly did this rename through normal editor renames. I then also did a search with various regexes over ever occurence of `//.*Analysis` and `//.*Borrowck` and `PostBorrowck`, and some more similar regexes to make sure as many comments as possible are updated, if not all. Notably, this PR does not update RustAnlayzer to use the same names yet. Warning: this PR may be somewhat conflicty :/
Rollup of 24 pull requests Successful merges: - rust-lang/rust#157716 (update Enzyme, June'26) - rust-lang/rust#149793 (Add inline asm support for amdgpu) - rust-lang/rust#155299 (make repr_transparent_non_zst_fields a hard error) - rust-lang/rust#157612 (Add a test where subtyping inhibits coercion.) - rust-lang/rust#157626 (Autogenerate unstable compiler flag stubs for unstable-book) - rust-lang/rust#157667 (Rename typing modes to better describe real usage) - rust-lang/rust#149749 (Make `BorrowedBuf` and `BorrowedCursor` generic over the data) - rust-lang/rust#155113 (Ensure Send/Sync impl for std::process::CommandArgs) - rust-lang/rust#156212 (Additionally gate negative bounds behind new `-Zinternal-testing-features`) - rust-lang/rust#157342 (Reduce verbosity of cycle errors when possible) - rust-lang/rust#157366 (Add a regression test for an unconstrained TransmuteFrom ICE) - rust-lang/rust#157459 (rustc_target: callconv: powerpc64: Remove unreachable fallback code path) - rust-lang/rust#157658 (UnsafeCell: mention shared-ref-to-interior case, fix aliasing model inaccuracy) - rust-lang/rust#157698 (Remove an unnecessary cloning) - rust-lang/rust#157699 (Arg splat experiment - hir FnDecl impl) - rust-lang/rust#157713 (resolve: Remove exported imports from `maybe_unused_trait_imports`) - rust-lang/rust#157722 (Move create_scope_map to rustc_codegen_ssa.) - rust-lang/rust#157723 (Move uninhabited unreachable code lint to rustc_mir_transform) - rust-lang/rust#157725 (Keep generic suggestion for macro-expanded missing-type items) - rust-lang/rust#157733 (Remove old FIXMEs about nocapture attribute) - rust-lang/rust#157737 (Reorganize `tests/ui/issues` [7/N]) - rust-lang/rust#157746 (supports_c_variadic_definitions: extend checklist for new targets) - rust-lang/rust#157763 (Move unused target expression error to appropriate place and rename it) - rust-lang/rust#157768 (codegen_ssa: peel trans. wrappers on scalable vecs)
r? @lcnr
cc: @BoxyUwU
Lcnr and I brainstormed these names before RustWeek, but I never got to actually changing it. As for rationale:
Coherence: stays the sameAnalysis: given that basically all of type checking is analyzing code, this didn't feel so accurate. It's now calledTypeckto signify that it's mainly used duringhir_typeck.Borrowck: this is the one that actually started the discussion about renaming. Borrowck is used in quite a few places now that are not Borrowck, simply to avoid making inference progress on opaque types. It's renamed toPostTypeckUntilBorrowck, since its used afterTypeck.PostBorrowckAnalysisis now simply calledPostBorrowck, since it's supposed to be used after borrowck finishes.PostAnalysisstays the same, it's the typing mode used after all type analysis finishedCodegentyping mode. It's unchanged too.To preempt some questions, I mainly did this rename through normal editor renames. I then also did a search with various regexes over ever occurence of
//.*Analysisand//.*BorrowckandPostBorrowck, and some more similar regexes to make sure as many comments as possible are updated, if not all.Notably, this PR does not update RustAnlayzer to use the same names yet.
Warning: this PR may be somewhat conflicty :/