From afb7472bcca54bffcab6841345cbf58e9f5dfa33 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Sat, 18 Sep 2021 09:34:06 +0200 Subject: [PATCH] Add a doc comment to infer_projection --- compiler/rustc_infer/src/infer/projection.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/rustc_infer/src/infer/projection.rs b/compiler/rustc_infer/src/infer/projection.rs index aa0fddf9b6f84..9b53ab72b00de 100644 --- a/compiler/rustc_infer/src/infer/projection.rs +++ b/compiler/rustc_infer/src/infer/projection.rs @@ -7,6 +7,12 @@ use super::type_variable::{TypeVariableOrigin, TypeVariableOriginKind}; use super::InferCtxt; impl<'a, 'tcx> InferCtxt<'a, 'tcx> { + /// Instead of normalizing an associated type projection, + /// this function generates an inference variable and registers + /// an obligation that this inference variable must be the result + /// of the given projection. This allows us to proceed with projections + /// while they cannot be resolved yet due to missing information or + /// simply due to the lack of access to the trait resolution machinery. pub fn infer_projection( &self, param_env: ty::ParamEnv<'tcx>,