about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOli Scherer <github35764891676564198441@oli-obk.de>2021-08-06 10:49:35 +0000
committerOli Scherer <github35764891676564198441@oli-obk.de>2021-08-06 10:49:35 +0000
commit238d974fc6fc3d28e35223c0cb4ef562e15f6728 (patch)
tree21e638f1d9483b70dd40acf803e52a2a1974c36e
parent1b9ad13941b0e6959470fe6e18b06848b75c262e (diff)
downloadrust-238d974fc6fc3d28e35223c0cb4ef562e15f6728.tar.gz
rust-238d974fc6fc3d28e35223c0cb4ef562e15f6728.zip
Document `with_opaque_type_inference`'s use cases.
-rw-r--r--compiler/rustc_infer/src/infer/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs
index dcd61604449..10217a5f574 100644
--- a/compiler/rustc_infer/src/infer/mod.rs
+++ b/compiler/rustc_infer/src/infer/mod.rs
@@ -581,6 +581,10 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
 
     /// 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