@@ -176,7 +176,7 @@ impl<'tcx> TyCtxt<'tcx> {
176
176
/// if input `ty` is not a structure at all.
177
177
pub fn struct_tail_without_normalization ( self , ty : Ty < ' tcx > ) -> Ty < ' tcx > {
178
178
let tcx = self ;
179
- tcx. struct_tail_with_normalize ( ty, |ty| ty, || { } )
179
+ tcx. struct_tail_raw ( ty, |ty| ty, || { } )
180
180
}
181
181
182
182
/// Returns the deeply last field of nested structures, or the same type if
@@ -188,20 +188,22 @@ impl<'tcx> TyCtxt<'tcx> {
188
188
/// normalization attempt may cause compiler bugs.
189
189
pub fn struct_tail_for_codegen ( self , ty : Ty < ' tcx > , param_env : ty:: ParamEnv < ' tcx > ) -> Ty < ' tcx > {
190
190
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) , || { } )
192
192
}
193
193
194
194
/// Returns the deeply last field of nested structures, or the same type if
195
195
/// not a structure at all. Corresponds to the only possible unsized field,
196
196
/// and its type can be used to determine unsizing strategy.
197
197
///
198
198
/// 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.
201
203
///
202
204
/// See also `struct_tail_for_codegen`, which is suitable for use
203
205
/// during codegen.
204
- pub fn struct_tail_with_normalize (
206
+ pub fn struct_tail_raw (
205
207
self ,
206
208
mut ty : Ty < ' tcx > ,
207
209
mut normalize : impl FnMut ( Ty < ' tcx > ) -> Ty < ' tcx > ,
@@ -281,7 +283,7 @@ impl<'tcx> TyCtxt<'tcx> {
281
283
param_env : ty:: ParamEnv < ' tcx > ,
282
284
) -> ( Ty < ' tcx > , Ty < ' tcx > ) {
283
285
let tcx = self ;
284
- tcx. struct_lockstep_tails_with_normalize ( source, target, |ty| {
286
+ tcx. struct_lockstep_tails_raw ( source, target, |ty| {
285
287
tcx. normalize_erasing_regions ( param_env, ty)
286
288
} )
287
289
}
@@ -294,7 +296,7 @@ impl<'tcx> TyCtxt<'tcx> {
294
296
///
295
297
/// See also `struct_lockstep_tails_for_codegen`, which is suitable for use
296
298
/// during codegen.
297
- pub fn struct_lockstep_tails_with_normalize (
299
+ pub fn struct_lockstep_tails_raw (
298
300
self ,
299
301
source : Ty < ' tcx > ,
300
302
target : Ty < ' tcx > ,
0 commit comments