diff options
| author | bors <bors@rust-lang.org> | 2024-12-17 12:07:32 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-12-17 12:07:32 +0000 | 
| commit | f23a80a4c2fbca593b64e70f5970368824b4c5e9 (patch) | |
| tree | fb6111f5c9f9064163fc6d3c6afcd5f158dc2f58 /compiler/rustc_middle/src/ty/context.rs | |
| parent | 604d6691d9ee5c88a05569dd3f707b20afd76e97 (diff) | |
| parent | cdd71c9f3d6c08cd35edddf56800aa1aacbdaedc (diff) | |
| download | rust-f23a80a4c2fbca593b64e70f5970368824b4c5e9.tar.gz rust-f23a80a4c2fbca593b64e70f5970368824b4c5e9.zip | |
Auto merge of #134414 - jhpratt:rollup-4gtfd1h, r=jhpratt
Rollup of 10 pull requests Successful merges: - #134202 (Remove `rustc::existing_doc_keyword` lint) - #134354 (Handle fndef rendering together with signature rendering) - #134365 (Rename `rustc_mir_build::build` to `builder`) - #134368 (Use links to edition guide for edition migrations) - #134397 (rustc_borrowck: Suggest changing `&raw const` to `&raw mut` if applicable) - #134398 (AIX: add alignment info for test) - #134400 (Fix some comments related to upvars handling) - #134406 (Fix `-Z input-stats` ordering) - #134409 (bootstrap: fix a comment) - #134412 (small borrowck cleanup) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_middle/src/ty/context.rs')
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 17 | 
1 files changed, 7 insertions, 10 deletions
| diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 3a1ed206c8b..24e44e5ba10 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -1119,10 +1119,10 @@ impl<'tcx> CommonConsts<'tcx> { /// either a `ReEarlyParam` or `ReLateParam`. #[derive(Debug)] pub struct FreeRegionInfo { - /// `LocalDefId` of the free region. - pub def_id: LocalDefId, - /// the bound region corresponding to free region. - pub bound_region: ty::BoundRegionKind, + /// `LocalDefId` of the scope. + pub scope: LocalDefId, + /// the `DefId` of the free region. + pub region_def_id: DefId, /// checks if bound region is in Impl Item pub is_impl_item: bool, } @@ -1960,7 +1960,7 @@ impl<'tcx> TyCtxt<'tcx> { generic_param_scope: LocalDefId, mut region: Region<'tcx>, ) -> Option<FreeRegionInfo> { - let (suitable_region_binding_scope, bound_region) = loop { + let (suitable_region_binding_scope, region_def_id) = loop { let def_id = region.opt_param_def_id(self, generic_param_scope.to_def_id())?.as_local()?; let scope = self.local_parent(def_id); @@ -1970,10 +1970,7 @@ impl<'tcx> TyCtxt<'tcx> { region = self.map_opaque_lifetime_to_parent_lifetime(def_id); continue; } - break ( - scope, - ty::BoundRegionKind::Named(def_id.into(), self.item_name(def_id.into())), - ); + break (scope, def_id.into()); }; let is_impl_item = match self.hir_node_by_def_id(suitable_region_binding_scope) { @@ -1982,7 +1979,7 @@ impl<'tcx> TyCtxt<'tcx> { _ => false, }; - Some(FreeRegionInfo { def_id: suitable_region_binding_scope, bound_region, is_impl_item }) + Some(FreeRegionInfo { scope: suitable_region_binding_scope, region_def_id, is_impl_item }) } /// Given a `DefId` for an `fn`, return all the `dyn` and `impl` traits in its return type. | 
