]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_infer/src/infer/higher_ranked/mod.rs
New upstream version 1.61.0+dfsg1
[rustc.git] / compiler / rustc_infer / src / infer / higher_ranked / mod.rs
index 82454b89156a6110d5b7a5199aab761ad56e6529..73cc411e533d346545c45beba9ac9c2a7f4e1d40 100644 (file)
@@ -58,14 +58,11 @@ impl<'a, 'tcx> CombineFields<'a, 'tcx> {
 }
 
 impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
-    /// Replaces all regions (resp. types) bound by `binder` with placeholder
-    /// regions (resp. types) and return a map indicating which bound-region
-    /// placeholder region. This is the first step of checking subtyping
-    /// when higher-ranked things are involved.
+    /// Replaces all bound variables (lifetimes, types, and constants) bound by
+    /// `binder` with placeholder variables.
     ///
-    /// **Important:** You have to be careful to not leak these placeholders,
-    /// for more information about how placeholders and HRTBs work, see
-    /// the [rustc dev guide].
+    /// This is the first step of checking subtyping when higher-ranked things are involved.
+    /// For more details visit the relevant sections of the [rustc dev guide].
     ///
     /// [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/traits/hrtb.html
     pub fn replace_bound_vars_with_placeholders<T>(&self, binder: ty::Binder<'tcx, T>) -> T
@@ -123,7 +120,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
         result
     }
 
-    /// See `infer::region_constraints::RegionConstraintCollector::leak_check`.
+    /// See [RegionConstraintCollector::leak_check][1].
+    ///
+    /// [1]: crate::infer::region_constraints::RegionConstraintCollector::leak_check
     pub fn leak_check(
         &self,
         overly_polymorphic: bool,