Remove TyCtxt::try_normalize_erasing_late_bound_regions.

It's unused.
This commit is contained in:
Nicholas Nethercote 2024-05-09 15:52:58 +10:00
parent 5b5dd1b3de
commit d13612bce7

View File

@ -100,8 +100,7 @@ pub fn try_normalize_erasing_regions<T>(
/// codegen, we need to normalize the contents.
// FIXME(@lcnr): This method should not be necessary, we now normalize
// inside of binders. We should be able to only use
// `tcx.instantiate_bound_regions_with_erased`. Same for the `try_X`
// variant.
// `tcx.instantiate_bound_regions_with_erased`.
#[tracing::instrument(level = "debug", skip(self, param_env))]
pub fn normalize_erasing_late_bound_regions<T>(
self,
@ -115,26 +114,6 @@ pub fn normalize_erasing_late_bound_regions<T>(
self.normalize_erasing_regions(param_env, value)
}
/// If you have a `Binder<'tcx, T>`, you can do this to strip out the
/// late-bound regions and then normalize the result, yielding up
/// a `T` (with regions erased). This is appropriate when the
/// binder is being instantiated at the call site.
///
/// N.B., currently, higher-ranked type bounds inhibit
/// normalization. Therefore, each time we erase them in
/// codegen, we need to normalize the contents.
pub fn try_normalize_erasing_late_bound_regions<T>(
self,
param_env: ty::ParamEnv<'tcx>,
value: ty::Binder<'tcx, T>,
) -> Result<T, NormalizationError<'tcx>>
where
T: TypeFoldable<TyCtxt<'tcx>>,
{
let value = self.instantiate_bound_regions_with_erased(value);
self.try_normalize_erasing_regions(param_env, value)
}
/// Monomorphizes a type from the AST by first applying the
/// in-scope instantiations and then normalizing any associated
/// types.