Skip to content

Commit 238d974

Browse files
committed
Document with_opaque_type_inference's use cases.
1 parent 1b9ad13 commit 238d974

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_infer/src/infer

1 file changed

+4
-0
lines changed

compiler/rustc_infer/src/infer/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,10 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
581581

582582
/// Whenever the `InferCtxt` should be able to handle defining uses of opaque types,
583583
/// you need to call this function. Otherwise the opaque type will be treated opaquely.
584+
///
585+
/// It is only meant to be called in two places, for typeck
586+
/// (via `with_fresh_in_progress_typeck_results`) and for the inference context used
587+
/// in mir borrowck.
584588
pub fn with_opaque_type_inference(mut self, defining_use_anchor: LocalDefId) -> Self {
585589
self.defining_use_anchor = defining_use_anchor;
586590
self

0 commit comments

Comments
 (0)