@@ -171,14 +171,6 @@ impl<'tcx> TyCtxt<'tcx> {
171171 }
172172 }
173173
174- /// Attempts to returns the deeply last field of nested structures, but
175- /// does not apply any normalization in its search. Returns the same type
176- /// if input `ty` is not a structure at all.
177- pub fn struct_tail_without_normalization ( self , ty : Ty < ' tcx > ) -> Ty < ' tcx > {
178- let tcx = self ;
179- tcx. struct_tail_with_normalize ( ty, |ty| ty, || { } )
180- }
181-
182174 /// Returns the deeply last field of nested structures, or the same type if
183175 /// not a structure at all. Corresponds to the only possible unsized field,
184176 /// and its type can be used to determine unsizing strategy.
@@ -188,20 +180,22 @@ impl<'tcx> TyCtxt<'tcx> {
188180 /// normalization attempt may cause compiler bugs.
189181 pub fn struct_tail_for_codegen ( self , ty : Ty < ' tcx > , param_env : ty:: ParamEnv < ' tcx > ) -> Ty < ' tcx > {
190182 let tcx = self ;
191- tcx. struct_tail_with_normalize ( ty, |ty| tcx. normalize_erasing_regions ( param_env, ty) , || { } )
183+ tcx. struct_tail_raw ( ty, |ty| tcx. normalize_erasing_regions ( param_env, ty) , || { } )
192184 }
193185
194186 /// Returns the deeply last field of nested structures, or the same type if
195187 /// not a structure at all. Corresponds to the only possible unsized field,
196188 /// and its type can be used to determine unsizing strategy.
197189 ///
198190 /// 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.
191+ /// handle `<T as Trait>::Assoc` and `impl Trait`). You almost certainly do
192+ /// **NOT** want to pass the identity function here, unless you know what
193+ /// you're doing, or you're within normalization code itself and will handle
194+ /// an unnormalized tail recursively.
201195 ///
202196 /// See also `struct_tail_for_codegen`, which is suitable for use
203197 /// during codegen.
204- pub fn struct_tail_with_normalize (
198+ pub fn struct_tail_raw (
205199 self ,
206200 mut ty : Ty < ' tcx > ,
207201 mut normalize : impl FnMut ( Ty < ' tcx > ) -> Ty < ' tcx > ,
@@ -281,7 +275,7 @@ impl<'tcx> TyCtxt<'tcx> {
281275 param_env : ty:: ParamEnv < ' tcx > ,
282276 ) -> ( Ty < ' tcx > , Ty < ' tcx > ) {
283277 let tcx = self ;
284- tcx. struct_lockstep_tails_with_normalize ( source, target, |ty| {
278+ tcx. struct_lockstep_tails_raw ( source, target, |ty| {
285279 tcx. normalize_erasing_regions ( param_env, ty)
286280 } )
287281 }
@@ -294,7 +288,7 @@ impl<'tcx> TyCtxt<'tcx> {
294288 ///
295289 /// See also `struct_lockstep_tails_for_codegen`, which is suitable for use
296290 /// during codegen.
297- pub fn struct_lockstep_tails_with_normalize (
291+ pub fn struct_lockstep_tails_raw (
298292 self ,
299293 source : Ty < ' tcx > ,
300294 target : Ty < ' tcx > ,
0 commit comments