From 238d974fc6fc3d28e35223c0cb4ef562e15f6728 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Fri, 6 Aug 2021 10:49:35 +0000 Subject: [PATCH] Document `with_opaque_type_inference`'s use cases. --- compiler/rustc_infer/src/infer/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) 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 @@ 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 -- 2.44.0