Skip to content

Remove RegionExt; move methods to Region in rustc_type_ir - #160509

Open
Jamesbarford wants to merge 2 commits into
rust-lang:mainfrom
Jamesbarford:chore/shrink-region-ext-triats-pt2
Open

Remove RegionExt; move methods to Region in rustc_type_ir#160509
Jamesbarford wants to merge 2 commits into
rust-lang:mainfrom
Jamesbarford:chore/shrink-region-ext-triats-pt2

Conversation

@Jamesbarford

@Jamesbarford Jamesbarford commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

View all comments

Removes RegionExt from rustc_middle with all methods on Region.

Some changes I think are worth pointing out (of which are all in the first commit -> f949bb7) ;

  • Changed the signature of Region::new_late_param to accept a I::LateParamRegion where previously it was able to construct a LateParamRegion from some method parameters.

added to interner:

  • fn span_delayed_bug(self, span: Self::Span, msg: impl ToString) -> Self::ErrorGuaranteed; which could be useful elsewhere when porting things across to rustc_type_ir
  • fn generics_of_early_param_region_def_id(self, def_id: Self::DefId, ebr: Self::EarlyParamRegion) -> Self::DefId; which is quite nasty but calling generics_of returned another type that I would have possibly create a trait for which felt more messy.
  • fn get_re_var_lifetime(self, var_idx: usize) -> Option<Region<'tcx>> need to get a region in Region::new_var.

traits added to inherent

  • RegionName so we can get the names of LateParamRegion and EarlyParamRegion with a get_name() and also is_named().
  • DefIdGetter so we can get the DefId of kind in LateParamRegion

r? lcnr

Part of #159654

@rustbot

rustbot commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

HIR ty lowering was modified

cc @fmease

@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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Aug 4, 2026
Comment thread compiler/rustc_middle/src/ty/context/impl_interner.rs Outdated
@lcnr

lcnr commented Aug 4, 2026

Copy link
Copy Markdown
Contributor
generics_of_early_param_region_def_id

hmm, without looking much at the code, I feel like we should move Generics into rustc_type_ir instead 🤔 how much effort is that/actually make it an inherent trait to make that transition easier in the future

Comment thread compiler/rustc_type_ir/src/sty/mod.rs Outdated
Comment thread compiler/rustc_type_ir/src/interner.rs Outdated
@rust-bors

This comment has been minimized.

@Jamesbarford
Jamesbarford force-pushed the chore/shrink-region-ext-triats-pt2 branch from d2eb2a2 to 78adf31 Compare August 6, 2026 08:05
@rustbot

This comment has been minimized.

@rust-bors

This comment has been minimized.

@Jamesbarford
Jamesbarford force-pushed the chore/shrink-region-ext-triats-pt2 branch from 78adf31 to 1625ceb Compare August 7, 2026 07:22
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@Jamesbarford
Jamesbarford force-pushed the chore/shrink-region-ext-triats-pt2 branch from 1625ceb to 21fdb0a Compare August 10, 2026 09:33
@rustbot

This comment has been minimized.

let r = ty::Region::new_late_param(self.infcx.tcx, self.mir_def.to_def_id(), kind);
let r = ty::Region::new_late_param(
self.infcx.tcx,
ty::LateParamRegion { scope: self.mir_def.to_def_id(), kind },

@lcnr lcnr Aug 11, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

alternative, rustc and rustc_type_ir agree on LateParamRegion except that they represent the actual region differently, which tbh, they shouldn't do 🤣 could we just move LateParamRegion into rustc_type_ir and then keep the current fn sig here?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm a bit slow on the uptake here, what do you mean by "just move"? Make a;

struct LateParamRegion<I: Interner> {
    pub scope: I::DefId,
    pub kind: I::LateParamRegionKind,
}

And possibly port across; pub enum LateParamRegionKind { too ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

exactly. LateParamRegionKind should prolly also be moved even if r-a currently slightly differs, I think it's easier for them to just use the same type

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

#160986 <- done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

with late param region being uplifted, you can keep this as two separate function arguments

Comment thread compiler/rustc_middle/src/ty/generics.rs Outdated
@rust-bors

This comment has been minimized.

@Jamesbarford
Jamesbarford force-pushed the chore/shrink-region-ext-triats-pt2 branch from 21fdb0a to c7e93c1 Compare August 12, 2026 07:29
@rustbot

This comment has been minimized.

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 17, 2026
…-region, r=lcnr

Move `LateParamRegion` to `rustc_type_ir`

Move `LateParamRegion` to `rustc_type_ir`. As per feedback, I created a `TrivialLiftImpls!` mirroring `rustc_middle`'s variant which is creates an identity function for `lift_to_interner(...)`.

Spun off from; rust-lang#160509

r? @lcnr
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 17, 2026
…-region, r=lcnr

Move `LateParamRegion` to `rustc_type_ir`

Move `LateParamRegion` to `rustc_type_ir`. As per feedback, I created a `TrivialLiftImpls!` mirroring `rustc_middle`'s variant which is creates an identity function for `lift_to_interner(...)`.

Spun off from; rust-lang#160509

r? @lcnr
rust-bors Bot pushed a commit that referenced this pull request Aug 17, 2026
Rollup merge of #160986 - Jamesbarford:chore/move-late-param-region, r=lcnr

Move `LateParamRegion` to `rustc_type_ir`

Move `LateParamRegion` to `rustc_type_ir`. As per feedback, I created a `TrivialLiftImpls!` mirroring `rustc_middle`'s variant which is creates an identity function for `lift_to_interner(...)`.

Spun off from; #160509

r? @lcnr
@rust-bors

This comment has been minimized.

@Jamesbarford
Jamesbarford force-pushed the chore/shrink-region-ext-triats-pt2 branch from c7e93c1 to d38ad3c Compare August 18, 2026 08:29
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Aug 24, 2026
…r=lcnr

Move `LateParamRegion` to `rustc_type_ir`

Move `LateParamRegion` to `rustc_type_ir`. As per feedback, I created a `TrivialLiftImpls!` mirroring `rustc_middle`'s variant which is creates an identity function for `lift_to_interner(...)`.

Spun off from; rust-lang/rust#160509

r? @lcnr
@Jamesbarford
Jamesbarford force-pushed the chore/shrink-region-ext-triats-pt2 branch from 4b48828 to f3cf30d Compare September 4, 2026 10:08
@rustbot

rustbot commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

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.

@fmease

fmease commented Sep 4, 2026

Copy link
Copy Markdown
Member

@bors r=lcnr

@rust-bors

rust-bors Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

📌 Commit f3cf30d has been approved by lcnr

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 4, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 4, 2026
…xt-triats-pt2, r=lcnr

Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`

Removes `RegionExt` from `rustc_middle` with all methods on `Region`.

Some changes I think are worth pointing out (of which are all in the first commit -> f949bb7) ;

- Changed the signature of `Region::new_late_param` to accept a `I::LateParamRegion` where previously it was able to construct a `LateParamRegion` from some method parameters.

**added to interner:**
- `fn span_delayed_bug(self, span: Self::Span, msg: impl ToString) -> Self::ErrorGuaranteed;` which could be useful elsewhere when porting things across to `rustc_type_ir`
- `fn generics_of_early_param_region_def_id(self, def_id: Self::DefId, ebr: Self::EarlyParamRegion) -> Self::DefId;` which is quite nasty but calling `generics_of` returned another type that I would have possibly create a trait for which felt more messy.
- `fn get_re_var_lifetime(self, var_idx: usize) -> Option<Region<'tcx>>` need to get a region in `Region::new_var`.

**traits added to inherent**
- `RegionName` so we can get the names of `LateParamRegion` and `EarlyParamRegion` with a `get_name()` and also `is_named()`.
- `DefIdGetter` so we can get the `DefId` of `kind` in `LateParamRegion`

r? lcnr

Part of rust-lang#159654
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Sep 4, 2026
…xt-triats-pt2, r=lcnr

Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`

Removes `RegionExt` from `rustc_middle` with all methods on `Region`.

Some changes I think are worth pointing out (of which are all in the first commit -> f949bb7) ;

- Changed the signature of `Region::new_late_param` to accept a `I::LateParamRegion` where previously it was able to construct a `LateParamRegion` from some method parameters.

**added to interner:**
- `fn span_delayed_bug(self, span: Self::Span, msg: impl ToString) -> Self::ErrorGuaranteed;` which could be useful elsewhere when porting things across to `rustc_type_ir`
- `fn generics_of_early_param_region_def_id(self, def_id: Self::DefId, ebr: Self::EarlyParamRegion) -> Self::DefId;` which is quite nasty but calling `generics_of` returned another type that I would have possibly create a trait for which felt more messy.
- `fn get_re_var_lifetime(self, var_idx: usize) -> Option<Region<'tcx>>` need to get a region in `Region::new_var`.

**traits added to inherent**
- `RegionName` so we can get the names of `LateParamRegion` and `EarlyParamRegion` with a `get_name()` and also `is_named()`.
- `DefIdGetter` so we can get the `DefId` of `kind` in `LateParamRegion`

r? lcnr

Part of rust-lang#159654
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Sep 4, 2026
…xt-triats-pt2, r=lcnr

Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`

Removes `RegionExt` from `rustc_middle` with all methods on `Region`.

Some changes I think are worth pointing out (of which are all in the first commit -> f949bb7) ;

- Changed the signature of `Region::new_late_param` to accept a `I::LateParamRegion` where previously it was able to construct a `LateParamRegion` from some method parameters.

**added to interner:**
- `fn span_delayed_bug(self, span: Self::Span, msg: impl ToString) -> Self::ErrorGuaranteed;` which could be useful elsewhere when porting things across to `rustc_type_ir`
- `fn generics_of_early_param_region_def_id(self, def_id: Self::DefId, ebr: Self::EarlyParamRegion) -> Self::DefId;` which is quite nasty but calling `generics_of` returned another type that I would have possibly create a trait for which felt more messy.
- `fn get_re_var_lifetime(self, var_idx: usize) -> Option<Region<'tcx>>` need to get a region in `Region::new_var`.

**traits added to inherent**
- `RegionName` so we can get the names of `LateParamRegion` and `EarlyParamRegion` with a `get_name()` and also `is_named()`.
- `DefIdGetter` so we can get the `DefId` of `kind` in `LateParamRegion`

r? lcnr

Part of rust-lang#159654
rust-bors Bot pushed a commit that referenced this pull request Sep 4, 2026
Rollup of 25 pull requests

Successful merges:

 - #159074 ([PAC] FnAbi, llvm.ptrauth.resign and Session API change (2/8))
 - #159792 (A more readable debug map for IndexMaps)
 - #161895 (std::sys::pal::sgx: fix mismatched alloc/free alignment)
 - #161900 (bootstrap: Include feature-gated items in bootstrap tool docs)
 - #161940 (Promote `wasm32-wasip3` to a tier 2 target)
 - #162072 (Add new Tier-3 target: `powerpc64-sony-ps3`)
 - #162179 (type system const items via direct rhs)
 - #162277 (Introduce `rustc_middle::middel::resolve`)
 - #162285 (box: fixup map/try_map deallocate calls)
 - #162286 (string: don't unwind prematurely)
 - #162289 (alloc: a bunch of safety comments)
 - #162292 (Update `askama` version to `0.16.1`)
 - #160509 (Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`)
 - #160906 (Suggest usize instead of placeholder type for array length constants)
 - #160936 (traits: Represent live alias arguments as bitsets)
 - #161400 (Improve diagnostics for references to closures)
 - #161656 (Suggest mutable references for FnMut closure arguments)
 - #161711 (Add more splat fn type tests)
 - #161786 (Make `tcx.def_id_partial_cmp` public)
 - #161953 (sanitizers: Implicitly disable mutually exclusive sanitizers)
 - #162155 (add suggestion for `rustc_allowed_through_unstable_modules` attribute)
 - #162212 (Implement `Rng` for `Box`)
 - #162246 (Fix incorrect meta span)
 - #162266 (std: fix typo)
 - #162291 (Add regression test from 1.98.1)
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Sep 4, 2026
…xt-triats-pt2, r=lcnr

Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`

Removes `RegionExt` from `rustc_middle` with all methods on `Region`.

Some changes I think are worth pointing out (of which are all in the first commit -> f949bb7) ;

- Changed the signature of `Region::new_late_param` to accept a `I::LateParamRegion` where previously it was able to construct a `LateParamRegion` from some method parameters.

**added to interner:**
- `fn span_delayed_bug(self, span: Self::Span, msg: impl ToString) -> Self::ErrorGuaranteed;` which could be useful elsewhere when porting things across to `rustc_type_ir`
- `fn generics_of_early_param_region_def_id(self, def_id: Self::DefId, ebr: Self::EarlyParamRegion) -> Self::DefId;` which is quite nasty but calling `generics_of` returned another type that I would have possibly create a trait for which felt more messy.
- `fn get_re_var_lifetime(self, var_idx: usize) -> Option<Region<'tcx>>` need to get a region in `Region::new_var`.

**traits added to inherent**
- `RegionName` so we can get the names of `LateParamRegion` and `EarlyParamRegion` with a `get_name()` and also `is_named()`.
- `DefIdGetter` so we can get the `DefId` of `kind` in `LateParamRegion`

r? lcnr

Part of rust-lang#159654
rust-bors Bot pushed a commit that referenced this pull request Sep 4, 2026
Rollup of 25 pull requests

Successful merges:

 - #159074 ([PAC] FnAbi, llvm.ptrauth.resign and Session API change (2/8))
 - #159792 (A more readable debug map for IndexMaps)
 - #160745 (make closures act like MaybeDangling)
 - #161895 (std::sys::pal::sgx: fix mismatched alloc/free alignment)
 - #161940 (Promote `wasm32-wasip3` to a tier 2 target)
 - #162072 (Add new Tier-3 target: `powerpc64-sony-ps3`)
 - #162179 (type system const items via direct rhs)
 - #162277 (Introduce `rustc_middle::middel::resolve`)
 - #162285 (box: fixup map/try_map deallocate calls)
 - #162286 (string: don't unwind prematurely)
 - #162289 (alloc: a bunch of safety comments)
 - #162292 (Update `askama` version to `0.16.1`)
 - #160509 (Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`)
 - #160906 (Suggest usize instead of placeholder type for array length constants)
 - #160936 (traits: Represent live alias arguments as bitsets)
 - #161400 (Improve diagnostics for references to closures)
 - #161656 (Suggest mutable references for FnMut closure arguments)
 - #161711 (Add more splat fn type tests)
 - #161786 (Make `tcx.def_id_partial_cmp` public)
 - #161953 (sanitizers: Implicitly disable mutually exclusive sanitizers)
 - #162155 (add suggestion for `rustc_allowed_through_unstable_modules` attribute)
 - #162212 (Implement `Rng` for `Box`)
 - #162246 (Fix incorrect meta span)
 - #162266 (std: fix typo)
 - #162291 (Add regression test from 1.98.1)
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Sep 4, 2026
…xt-triats-pt2, r=lcnr

Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`

Removes `RegionExt` from `rustc_middle` with all methods on `Region`.

Some changes I think are worth pointing out (of which are all in the first commit -> f949bb7) ;

- Changed the signature of `Region::new_late_param` to accept a `I::LateParamRegion` where previously it was able to construct a `LateParamRegion` from some method parameters.

**added to interner:**
- `fn span_delayed_bug(self, span: Self::Span, msg: impl ToString) -> Self::ErrorGuaranteed;` which could be useful elsewhere when porting things across to `rustc_type_ir`
- `fn generics_of_early_param_region_def_id(self, def_id: Self::DefId, ebr: Self::EarlyParamRegion) -> Self::DefId;` which is quite nasty but calling `generics_of` returned another type that I would have possibly create a trait for which felt more messy.
- `fn get_re_var_lifetime(self, var_idx: usize) -> Option<Region<'tcx>>` need to get a region in `Region::new_var`.

**traits added to inherent**
- `RegionName` so we can get the names of `LateParamRegion` and `EarlyParamRegion` with a `get_name()` and also `is_named()`.
- `DefIdGetter` so we can get the `DefId` of `kind` in `LateParamRegion`

r? lcnr

Part of rust-lang#159654
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Sep 4, 2026
…xt-triats-pt2, r=lcnr

Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`

Removes `RegionExt` from `rustc_middle` with all methods on `Region`.

Some changes I think are worth pointing out (of which are all in the first commit -> f949bb7) ;

- Changed the signature of `Region::new_late_param` to accept a `I::LateParamRegion` where previously it was able to construct a `LateParamRegion` from some method parameters.

**added to interner:**
- `fn span_delayed_bug(self, span: Self::Span, msg: impl ToString) -> Self::ErrorGuaranteed;` which could be useful elsewhere when porting things across to `rustc_type_ir`
- `fn generics_of_early_param_region_def_id(self, def_id: Self::DefId, ebr: Self::EarlyParamRegion) -> Self::DefId;` which is quite nasty but calling `generics_of` returned another type that I would have possibly create a trait for which felt more messy.
- `fn get_re_var_lifetime(self, var_idx: usize) -> Option<Region<'tcx>>` need to get a region in `Region::new_var`.

**traits added to inherent**
- `RegionName` so we can get the names of `LateParamRegion` and `EarlyParamRegion` with a `get_name()` and also `is_named()`.
- `DefIdGetter` so we can get the `DefId` of `kind` in `LateParamRegion`

r? lcnr

Part of rust-lang#159654
rust-bors Bot pushed a commit that referenced this pull request Sep 4, 2026
Rollup of 27 pull requests

Successful merges:

 - #159074 ([PAC] FnAbi, llvm.ptrauth.resign and Session API change (2/8))
 - #159792 (A more readable debug map for IndexMaps)
 - #160745 (make closures act like MaybeDangling)
 - #161940 (Promote `wasm32-wasip3` to a tier 2 target)
 - #162030 (Prevent `--test` to be used in `rustdoc-html` testsuite)
 - #162072 (Add new Tier-3 target: `powerpc64-sony-ps3`)
 - #162179 (type system const items via direct rhs)
 - #162262 (Avoid manually instantiating some binders in error reporting with `-Znext-solver`)
 - #162277 (Introduce `rustc_middle::middel::resolve`)
 - #162285 (box: fixup map/try_map deallocate calls)
 - #162286 (string: don't unwind prematurely)
 - #162289 (alloc: a bunch of safety comments)
 - #162290 (abby test DSL: AliasTyOutlivesViaEnv)
 - #162292 (Update `askama` version to `0.16.1`)
 - #160509 (Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`)
 - #160906 (Suggest usize instead of placeholder type for array length constants)
 - #160936 (traits: Represent live alias arguments as bitsets)
 - #161400 (Improve diagnostics for references to closures)
 - #161656 (Suggest mutable references for FnMut closure arguments)
 - #161711 (Add more splat fn type tests)
 - #161786 (Make `tcx.def_id_partial_cmp` public)
 - #161953 (sanitizers: Implicitly disable mutually exclusive sanitizers)
 - #162155 (add suggestion for `rustc_allowed_through_unstable_modules` attribute)
 - #162212 (Implement `Rng` for `Box`)
 - #162246 (Fix incorrect meta span)
 - #162266 (std: fix typo)
 - #162291 (Add regression test from 1.98.1)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 4, 2026
…xt-triats-pt2, r=lcnr

Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`

Removes `RegionExt` from `rustc_middle` with all methods on `Region`.

Some changes I think are worth pointing out (of which are all in the first commit -> f949bb7) ;

- Changed the signature of `Region::new_late_param` to accept a `I::LateParamRegion` where previously it was able to construct a `LateParamRegion` from some method parameters.

**added to interner:**
- `fn span_delayed_bug(self, span: Self::Span, msg: impl ToString) -> Self::ErrorGuaranteed;` which could be useful elsewhere when porting things across to `rustc_type_ir`
- `fn generics_of_early_param_region_def_id(self, def_id: Self::DefId, ebr: Self::EarlyParamRegion) -> Self::DefId;` which is quite nasty but calling `generics_of` returned another type that I would have possibly create a trait for which felt more messy.
- `fn get_re_var_lifetime(self, var_idx: usize) -> Option<Region<'tcx>>` need to get a region in `Region::new_var`.

**traits added to inherent**
- `RegionName` so we can get the names of `LateParamRegion` and `EarlyParamRegion` with a `get_name()` and also `is_named()`.
- `DefIdGetter` so we can get the `DefId` of `kind` in `LateParamRegion`

r? lcnr

Part of rust-lang#159654
rust-bors Bot pushed a commit that referenced this pull request Sep 5, 2026
…uwer

Rollup of 25 pull requests

Successful merges:

 - #162072 (Add new Tier-3 target: `powerpc64-sony-ps3`)
 - #162179 (type system const items via direct rhs)
 - #162255 (let people change rustc-dev-guide in-tree)
 - #162262 (Avoid manually instantiating some binders in error reporting with `-Znext-solver`)
 - #162277 (Introduce `rustc_middle::middel::resolve`)
 - #162285 (box: fixup map/try_map deallocate calls)
 - #162286 (string: don't unwind prematurely)
 - #162289 (alloc: a bunch of safety comments)
 - #162290 (abby test DSL: AliasTyOutlivesViaEnv)
 - #162292 (Update `askama` version to `0.16.1`)
 - #160509 (Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`)
 - #160906 (Suggest usize instead of placeholder type for array length constants)
 - #160936 (traits: Represent live alias arguments as bitsets)
 - #161394 (fix `is_homogeneous_aggregate`: use unit size, not total size )
 - #161400 (Improve diagnostics for references to closures)
 - #161656 (Suggest mutable references for FnMut closure arguments)
 - #161711 (Add more splat fn type tests)
 - #161786 (Make `tcx.def_id_partial_cmp` public)
 - #161953 (sanitizers: Implicitly disable mutually exclusive sanitizers)
 - #162155 (add suggestion for `rustc_allowed_through_unstable_modules` attribute)
 - #162212 (Implement `Rng` for `Box`)
 - #162246 (Fix incorrect meta span)
 - #162266 (std: fix typo)
 - #162291 (Add regression test from 1.98.1)
 - #162303 (Fix a minor spelling error in `library/std/src/sys/fs/unix.rs`)
Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 5, 2026
…xt-triats-pt2, r=lcnr

Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`

Removes `RegionExt` from `rustc_middle` with all methods on `Region`.

Some changes I think are worth pointing out (of which are all in the first commit -> f949bb7) ;

- Changed the signature of `Region::new_late_param` to accept a `I::LateParamRegion` where previously it was able to construct a `LateParamRegion` from some method parameters.

**added to interner:**
- `fn span_delayed_bug(self, span: Self::Span, msg: impl ToString) -> Self::ErrorGuaranteed;` which could be useful elsewhere when porting things across to `rustc_type_ir`
- `fn generics_of_early_param_region_def_id(self, def_id: Self::DefId, ebr: Self::EarlyParamRegion) -> Self::DefId;` which is quite nasty but calling `generics_of` returned another type that I would have possibly create a trait for which felt more messy.
- `fn get_re_var_lifetime(self, var_idx: usize) -> Option<Region<'tcx>>` need to get a region in `Region::new_var`.

**traits added to inherent**
- `RegionName` so we can get the names of `LateParamRegion` and `EarlyParamRegion` with a `get_name()` and also `is_named()`.
- `DefIdGetter` so we can get the `DefId` of `kind` in `LateParamRegion`

r? lcnr

Part of rust-lang#159654
rust-bors Bot pushed a commit that referenced this pull request Sep 5, 2026
…uwer

Rollup of 25 pull requests

Successful merges:

 - #162072 (Add new Tier-3 target: `powerpc64-sony-ps3`)
 - #162179 (type system const items via direct rhs)
 - #162255 (let people change rustc-dev-guide in-tree)
 - #162262 (Avoid manually instantiating some binders in error reporting with `-Znext-solver`)
 - #162277 (Introduce `rustc_middle::middel::resolve`)
 - #162285 (box: fixup map/try_map deallocate calls)
 - #162286 (string: don't unwind prematurely)
 - #162289 (alloc: a bunch of safety comments)
 - #162290 (abby test DSL: AliasTyOutlivesViaEnv)
 - #162292 (Update `askama` version to `0.16.1`)
 - #160509 (Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`)
 - #160906 (Suggest usize instead of placeholder type for array length constants)
 - #160936 (traits: Represent live alias arguments as bitsets)
 - #161394 (fix `is_homogeneous_aggregate`: use unit size, not total size )
 - #161400 (Improve diagnostics for references to closures)
 - #161656 (Suggest mutable references for FnMut closure arguments)
 - #161711 (Add more splat fn type tests)
 - #161786 (Make `tcx.def_id_partial_cmp` public)
 - #161953 (sanitizers: Implicitly disable mutually exclusive sanitizers)
 - #162155 (add suggestion for `rustc_allowed_through_unstable_modules` attribute)
 - #162212 (Implement `Rng` for `Box`)
 - #162246 (Fix incorrect meta span)
 - #162266 (std: fix typo)
 - #162291 (Add regression test from 1.98.1)
 - #162303 (Fix a minor spelling error in `library/std/src/sys/fs/unix.rs`)
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. T-rustdoc Relevant to the rustdoc 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