Skip to content

Commit

Permalink
Remove TyCtxt::try_normalize_erasing_late_bound_regions.
Browse files Browse the repository at this point in the history
It's unused.
  • Loading branch information
nnethercote committed May 9, 2024
1 parent 588376a commit 39c1405
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions compiler/rustc_middle/src/ty/normalize_erasing_regions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ impl<'tcx> TyCtxt<'tcx> {
/// 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,
Expand All @@ -115,26 +114,6 @@ impl<'tcx> TyCtxt<'tcx> {
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.
Expand Down

0 comments on commit 39c1405

Please sign in to comment.