@@ -176,7 +176,7 @@ impl<'tcx> TyCtxt<'tcx> {
176176 /// if input `ty` is not a structure at all.
177177 pub fn struct_tail_without_normalization ( self , ty : Ty < ' tcx > ) -> Ty < ' tcx > {
178178 let tcx = self ;
179- tcx. struct_tail_with_normalize ( ty, |ty| ty, || { } )
179+ tcx. struct_tail_raw ( ty, |ty| ty, || { } )
180180 }
181181
182182 /// Returns the deeply last field of nested structures, or the same type if
@@ -188,20 +188,22 @@ impl<'tcx> TyCtxt<'tcx> {
188188 /// normalization attempt may cause compiler bugs.
189189 pub fn struct_tail_for_codegen ( self , ty : Ty < ' tcx > , param_env : ty:: ParamEnv < ' tcx > ) -> Ty < ' tcx > {
190190 let tcx = self ;
191- tcx. struct_tail_with_normalize ( ty, |ty| tcx. normalize_erasing_regions ( param_env, ty) , || { } )
191+ tcx. struct_tail_raw ( ty, |ty| tcx. normalize_erasing_regions ( param_env, ty) , || { } )
192192 }
193193
194194 /// Returns the deeply last field of nested structures, or the same type if
195195 /// not a structure at all. Corresponds to the only possible unsized field,
196196 /// and its type can be used to determine unsizing strategy.
197197 ///
198198 /// This is parameterized over the normalization strategy (i.e. how to
199- /// handle `<T as Trait>::Assoc` and `impl Trait`); pass the identity
200- /// function to indicate no normalization should take place.
199+ /// handle `<T as Trait>::Assoc` and `impl Trait`). You almost certainly do
200+ /// **NOT** want to pass the identity function here, unless you know what
201+ /// you're doing, or you're within normalization code itself and will handle
202+ /// an unnormalized tail recursively.
201203 ///
202204 /// See also `struct_tail_for_codegen`, which is suitable for use
203205 /// during codegen.
204- pub fn struct_tail_with_normalize (
206+ pub fn struct_tail_raw (
205207 self ,
206208 mut ty : Ty < ' tcx > ,
207209 mut normalize : impl FnMut ( Ty < ' tcx > ) -> Ty < ' tcx > ,
@@ -281,7 +283,7 @@ impl<'tcx> TyCtxt<'tcx> {
281283 param_env : ty:: ParamEnv < ' tcx > ,
282284 ) -> ( Ty < ' tcx > , Ty < ' tcx > ) {
283285 let tcx = self ;
284- tcx. struct_lockstep_tails_with_normalize ( source, target, |ty| {
286+ tcx. struct_lockstep_tails_raw ( source, target, |ty| {
285287 tcx. normalize_erasing_regions ( param_env, ty)
286288 } )
287289 }
@@ -294,7 +296,7 @@ impl<'tcx> TyCtxt<'tcx> {
294296 ///
295297 /// See also `struct_lockstep_tails_for_codegen`, which is suitable for use
296298 /// during codegen.
297- pub fn struct_lockstep_tails_with_normalize (
299+ pub fn struct_lockstep_tails_raw (
298300 self ,
299301 source : Ty < ' tcx > ,
300302 target : Ty < ' tcx > ,
0 commit comments