Add a doc comment to infer_projection

This commit is contained in:
Oli Scherer 2021-09-18 09:34:06 +02:00 committed by Oli Scherer
parent b952ada0ae
commit afb7472bcc

View File

@ -7,6 +7,12 @@ use super::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
use super::InferCtxt; use super::InferCtxt;
impl<'a, 'tcx> InferCtxt<'a, 'tcx> { 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( pub fn infer_projection(
&self, &self,
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,