about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-05-09 15:52:58 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-05-10 09:55:09 +1000
commitd13612bce75ead7509a45356fe6ffcdcc14f3055 (patch)
tree2c6b1c4e4c06481d06e198b02ffe65f53043900f
parent5b5dd1b3de76161d2079eca9d3c4fe280190ca1c (diff)
downloadrust-d13612bce75ead7509a45356fe6ffcdcc14f3055.tar.gz
rust-d13612bce75ead7509a45356fe6ffcdcc14f3055.zip
Remove `TyCtxt::try_normalize_erasing_late_bound_regions`.
It's unused.
-rw-r--r--compiler/rustc_middle/src/ty/normalize_erasing_regions.rs23
1 files changed, 1 insertions, 22 deletions
diff --git a/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs b/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs
index 791f27a9789..115cf3eeb22 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<T>(
         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<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.