about summary refs log tree commit diff
diff options
context:
space:
mode:
authormejrs <59372212+mejrs@users.noreply.github.com>2024-11-05 01:08:20 +0100
committermejrs <59372212+mejrs@users.noreply.github.com>2024-11-05 01:08:20 +0100
commite37a3a85e44f2c43442acf41e5d9d704738ee84c (patch)
tree9cd2b1a50072fd5a294c10a623f44f0765bb65a5
parentc88ba28d9a0261f448471255bd913e673858abaa (diff)
downloadrust-e37a3a85e44f2c43442acf41e5d9d704738ee84c.tar.gz
rust-e37a3a85e44f2c43442acf41e5d9d704738ee84c.zip
Explain how to evaluate an obligation
-rw-r--r--compiler/rustc_trait_selection/src/infer.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler/rustc_trait_selection/src/infer.rs b/compiler/rustc_trait_selection/src/infer.rs
index e91574fa1af..8f1c8a29663 100644
--- a/compiler/rustc_trait_selection/src/infer.rs
+++ b/compiler/rustc_trait_selection/src/infer.rs
@@ -69,9 +69,15 @@ impl<'tcx> InferCtxt<'tcx> {
     /// .must_apply_modulo_regions();
     /// ```
     ///
-    /// In most cases you should instead create an [Obligation](traits::Obligation)
-    /// and check whether it holds, because it properly handles higher ranked traits
-    /// and it is more convenient and safer when your `params` are inside a `Binder`.
+    /// In most cases you should instead create an [Obligation] and check whether
+    ///  it holds via [`evaluate_obligation`] or one of its helper functions like
+    /// [`predicate_must_hold_modulo_regions`], because it properly handles higher ranked traits
+    /// and it is more convenient and safer when your `params` are inside a [`Binder`].
+    ///
+    /// [Obligation]: traits::Obligation
+    /// [`evaluate_obligation`]: crate::traits::query::evaluate_obligation::InferCtxtExt::evaluate_obligation
+    /// [`predicate_must_hold_modulo_regions`]: crate::traits::query::evaluate_obligation::InferCtxtExt::predicate_must_hold_modulo_regions
+    /// [`Binder`]: ty::Binder
     #[instrument(level = "debug", skip(self, params), ret)]
     fn type_implements_trait(
         &self,