diff --git a/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs b/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs index 791f27a97896d..115cf3eeb226c 100644 --- a/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs +++ b/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs @@ -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( self, @@ -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( - self, - param_env: ty::ParamEnv<'tcx>, - value: ty::Binder<'tcx, T>, - ) -> Result> - where - T: TypeFoldable>, - { - 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.