@@ -8,7 +8,7 @@ use rustc_infer::infer::outlives::env::RegionBoundPairs;
88use rustc_infer:: infer:: { InferCtxt , NllRegionVariableOrigin , OpaqueTypeStorageEntries } ;
99use rustc_infer:: traits:: ObligationCause ;
1010use rustc_macros:: extension;
11- use rustc_middle:: mir:: { Body , ConstraintCategory , HiddenTypes } ;
11+ use rustc_middle:: mir:: { Body , ConstraintCategory , DefinitionSiteHiddenTypes } ;
1212use rustc_middle:: ty:: {
1313 self , DefiningScopeKind , EarlyBinder , FallibleTypeFolder , GenericArg , GenericArgsRef ,
1414 OpaqueHiddenType , OpaqueTypeKey , Region , RegionVid , Ty , TyCtxt , TypeFoldable ,
@@ -131,7 +131,7 @@ fn nll_var_to_universal_region<'tcx>(
131131/// and errors if we end up with distinct hidden types.
132132fn add_hidden_type < ' tcx > (
133133 tcx : TyCtxt < ' tcx > ,
134- hidden_types : & mut HiddenTypes < ' tcx > ,
134+ hidden_types : & mut DefinitionSiteHiddenTypes < ' tcx > ,
135135 def_id : LocalDefId ,
136136 hidden_ty : OpaqueHiddenType < ' tcx > ,
137137) {
@@ -156,7 +156,7 @@ fn add_hidden_type<'tcx>(
156156}
157157
158158fn get_hidden_type < ' tcx > (
159- hidden_types : & HiddenTypes < ' tcx > ,
159+ hidden_types : & DefinitionSiteHiddenTypes < ' tcx > ,
160160 def_id : LocalDefId ,
161161) -> Option < EarlyBinder < ' tcx , OpaqueHiddenType < ' tcx > > > {
162162 hidden_types. 0 . get ( & def_id) . map ( |ty| EarlyBinder :: bind ( * ty) )
@@ -183,12 +183,12 @@ struct DefiningUse<'tcx> {
183183///
184184/// It also means that this whole function is not really soundness critical as we
185185/// recheck all uses of the opaques regardless.
186- pub ( crate ) fn compute_hidden_types < ' tcx > (
186+ pub ( crate ) fn compute_definition_site_hidden_types < ' tcx > (
187187 infcx : & BorrowckInferCtxt < ' tcx > ,
188188 universal_region_relations : & Frozen < UniversalRegionRelations < ' tcx > > ,
189189 constraints : & MirTypeckRegionConstraints < ' tcx > ,
190190 location_map : Rc < DenseLocationMap > ,
191- hidden_types : & mut HiddenTypes < ' tcx > ,
191+ hidden_types : & mut DefinitionSiteHiddenTypes < ' tcx > ,
192192 opaque_types : & [ ( OpaqueTypeKey < ' tcx > , OpaqueHiddenType < ' tcx > ) ] ,
193193) -> Vec < DeferredOpaqueTypeError < ' tcx > > {
194194 let mut errors = Vec :: new ( ) ;
@@ -211,14 +211,14 @@ pub(crate) fn compute_hidden_types<'tcx>(
211211 // After applying member constraints, we now check whether all member regions ended
212212 // up equal to one of their choice regions and compute the actual hidden type of
213213 // the opaque type definition. This is stored in the `root_cx`.
214- compute_hidden_types_from_defining_uses ( & rcx, hidden_types, & defining_uses, & mut errors) ;
214+ compute_definition_site_hidden_types_from_defining_uses ( & rcx, hidden_types, & defining_uses, & mut errors) ;
215215 errors
216216}
217217
218218#[ instrument( level = "debug" , skip_all, ret) ]
219219fn collect_defining_uses < ' tcx > (
220220 rcx : & mut RegionCtxt < ' _ , ' tcx > ,
221- hidden_types : & mut HiddenTypes < ' tcx > ,
221+ hidden_types : & mut DefinitionSiteHiddenTypes < ' tcx > ,
222222 opaque_types : & [ ( OpaqueTypeKey < ' tcx > , OpaqueHiddenType < ' tcx > ) ] ,
223223 errors : & mut Vec < DeferredOpaqueTypeError < ' tcx > > ,
224224) -> Vec < DefiningUse < ' tcx > > {
@@ -271,9 +271,9 @@ fn collect_defining_uses<'tcx>(
271271 defining_uses
272272}
273273
274- fn compute_hidden_types_from_defining_uses < ' tcx > (
274+ fn compute_definition_site_hidden_types_from_defining_uses < ' tcx > (
275275 rcx : & RegionCtxt < ' _ , ' tcx > ,
276- hidden_types : & mut HiddenTypes < ' tcx > ,
276+ hidden_types : & mut DefinitionSiteHiddenTypes < ' tcx > ,
277277 defining_uses : & [ DefiningUse < ' tcx > ] ,
278278 errors : & mut Vec < DeferredOpaqueTypeError < ' tcx > > ,
279279) {
@@ -483,14 +483,14 @@ impl<'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for ToArgRegionsFolder<'_, 'tcx> {
483483///
484484/// It does this by equating the hidden type of each use with the instantiated final
485485/// hidden type of the opaque.
486- pub ( crate ) fn apply_hidden_types < ' tcx > (
486+ pub ( crate ) fn apply_definition_site_hidden_types < ' tcx > (
487487 infcx : & BorrowckInferCtxt < ' tcx > ,
488488 body : & Body < ' tcx > ,
489489 universal_regions : & UniversalRegions < ' tcx > ,
490490 region_bound_pairs : & RegionBoundPairs < ' tcx > ,
491491 known_type_outlives_obligations : & [ ty:: PolyTypeOutlivesPredicate < ' tcx > ] ,
492492 constraints : & mut MirTypeckRegionConstraints < ' tcx > ,
493- hidden_types : & mut HiddenTypes < ' tcx > ,
493+ hidden_types : & mut DefinitionSiteHiddenTypes < ' tcx > ,
494494 opaque_types : & [ ( OpaqueTypeKey < ' tcx > , OpaqueHiddenType < ' tcx > ) ] ,
495495) -> Vec < DeferredOpaqueTypeError < ' tcx > > {
496496 let tcx = infcx. tcx ;
@@ -561,7 +561,7 @@ pub(crate) fn apply_hidden_types<'tcx>(
561561 errors
562562}
563563
564- /// In theory `apply_hidden_types ` could introduce new uses of opaque types.
564+ /// In theory `apply_definition_site_hidden_types ` could introduce new uses of opaque types.
565565/// We do not check these new uses so this could be unsound.
566566///
567567/// We detect any new uses and simply delay a bug if they occur. If this results in
0 commit comments