]> git.lizzy.rs Git - rust.git/commitdiff
Document `with_opaque_type_inference`'s use cases.
authorOli Scherer <github35764891676564198441@oli-obk.de>
Fri, 6 Aug 2021 10:49:35 +0000 (10:49 +0000)
committerOli Scherer <github35764891676564198441@oli-obk.de>
Fri, 6 Aug 2021 10:49:35 +0000 (10:49 +0000)
compiler/rustc_infer/src/infer/mod.rs

index dcd61604449aca0c6360faf5b235c0853ead8b6c..10217a5f5749809d6615794d19f942a039c788d6 100644 (file)
@@ -581,6 +581,10 @@ pub fn with_fresh_in_progress_typeck_results(mut self, table_owner: LocalDefId)
 
     /// Whenever the `InferCtxt` should be able to handle defining uses of opaque types,
     /// you need to call this function. Otherwise the opaque type will be treated opaquely.
+    ///
+    /// It is only meant to be called in two places, for typeck
+    /// (via `with_fresh_in_progress_typeck_results`) and for the inference context used
+    /// in mir borrowck.
     pub fn with_opaque_type_inference(mut self, defining_use_anchor: LocalDefId) -> Self {
         self.defining_use_anchor = defining_use_anchor;
         self